CVE-2020-15229 Path traversal and files overwrite with unsquashfs
Attackers can overwrite host files via crafted squashfs images, leading to system compromise, especially during root builds.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2020-15229?
CVE-2020-15229 is a high-severity path traversal vulnerability in Opensuse Backports Sle, published on 14 Oct 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Singularity (an open source container platform) from version 3.1.1 through 3.6.3 has a vulnerability. Due to insecure handling of path traversal and the lack of path sanitization within `unsquashfs`, it is possible to overwrite/create any files on the host filesystem during the extraction with a crafted squashfs filesystem. The extraction occurs automatically for unprivileged (either installation or with `allow setuid = no`) run of Singularity when a user attempt to run an image which is a local SIF image or a single file containing a squashfs filesystem and is coming from remote sources `library://` or `shub://`. Image build is also impacted in a more serious way as it can be used by a root user, allowing an attacker to overwrite/create files leading to a system compromise, so far bootstrap methods `library`, `shub` and `localimage` are triggering the squashfs extraction. 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. There is no solid workaround except to temporary avoid to use unprivileged mode with single file images in favor of sandbox images instead. Regarding image build, temporary avoid to build from `library` and `shub` sources and as much as possible use `--fakeroot` or a VM for that.
Weakness: CWE-22
Which versions are affected by CVE-2020-15229?
2 open source packages ship an affected version, including github.com/sylabs/singularity. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
github.com/sylabs/singularity Go | From 3.1.1 | 3.6.4 |
github.com/sylabs/singularity Go | From 3.1.1 | 3.6.4 |
Linux distribution packages (3)
singularity SUSE:Package Hub 15 SP2 | All versions | 3.6.4-bp152.2.12.1 |
singularity openSUSE:Leap 15.1 | All versions | 3.6.4-lp151.2.12.1 |
singularity openSUSE:Leap 15.2 | All versions | 3.6.4-lp152.2.9.1 |
Products include Opensuse Backports Sle, Opensuse Leap, Sylabs Singularity.
How do I fix CVE-2020-15229?
Upgrade github.com/sylabs/singularity to 3.6.4 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2020-15229 being exploited?
There is no known exploitation of CVE-2020-15229 in the wild and no public exploit code.
Other vulnerabilities in Opensuse Backports Sle
Sources
Also known as GHSA-7gcp-w6ww-2xv9, openSUSE-SU-2020:1769-1, openSUSE-SU-2020:1770-1, openSUSE-SU-2020:1814-1.