GHSA-7gcp-w6ww-2xv9

Suggest an improvement
Source
https://github.com/advisories/GHSA-7gcp-w6ww-2xv9
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/05/GHSA-7gcp-w6ww-2xv9/GHSA-7gcp-w6ww-2xv9.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-7gcp-w6ww-2xv9
Aliases
Published
2021-05-24T16:59:53Z
Modified
2023-11-01T04:52:01.308042Z
Severity
  • 8.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N CVSS Calculator
Summary
Path traversal and files overwrite with unsquashfs in singularity
Details

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: security@sylabs.io

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

Database specific
{
    "nvd_published_at": "2020-10-14T19:15:00Z",
    "github_reviewed_at": "2021-05-21T22:17:06Z",
    "severity": "HIGH",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-22"
    ]
}
References

Affected packages

Go / github.com/sylabs/singularity

Package

Name
github.com/sylabs/singularity
View open source insights on deps.dev
Purl
pkg:golang/github.com/sylabs/singularity

Affected ranges

Type
SEMVER
Events
Introduced
3.1.1
Fixed
3.6.4