Skip to content

Path traversal and files overwrite with unsquashfs in singularity

High severity GitHub Reviewed Published Oct 13, 2020 in apptainer/singularity • Updated Feb 1, 2023

Package

gomod github.com/sylabs/singularity (Go)

Affected versions

>= 3.1.1, < 3.6.4

Patched versions

3.6.4

Description

Impact

Due to insecure handling of path traversal and the lack of path sanitization within unsquashfs (a distribution provided utility used by Singularity), it is possible to overwrite/create any files on the host filesystem during the extraction of a crafted squashfs filesystem.

Squashfs extraction occurs automatically for unprivileged execution of Singularity (either --without-suid installation or with allow setuid = no) when a user attempts to run an image which:

  • is a local SIF image or a single file containing a squashfs filesystem
  • is pulled from remote sources library:// or shub://

Image build is also impacted in a more serious way as it is often performed by the root user, allowing an attacker to overwrite/create files leading to a system compromise. Bootstrap methods library, shub and localimage trigger a squashfs extraction.

Patches

This issue is addressed in Singularity 3.6.4.

All users are advised to upgrade to 3.6.4 especially if they use Singularity mainly for building image as root user.

Workarounds

There is no solid workaround except to temporarily avoid use of unprivileged mode with single file images, in favor of sandbox images instead. Regarding image build, temporarily avoid building from library and shub sources, and as much as possible use --fakeroot or a VM to limit potential impact.

For more information

General questions about the impact of the advisory / changes made in the 3.6.0 release can be asked in the:

Any sensitive security concerns should be directed to: [email protected]

See our Security Policy here: https://sylabs.io/security-policy

References

@dtrudg dtrudg published to apptainer/singularity Oct 13, 2020
Published by the National Vulnerability Database Oct 14, 2020
Reviewed May 21, 2021
Published to the GitHub Advisory Database May 24, 2021
Last updated Feb 1, 2023

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N

EPSS score

0.271%
(68th percentile)

Weaknesses

CVE ID

CVE-2020-15229

GHSA ID

GHSA-7gcp-w6ww-2xv9

Source code

No known source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.