Bug 1888811 (CVE-2020-15229)

Summary: CVE-2020-15229 singularity: path traversal and files overwrite with unsquashfs
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: bbockelm, dave.love, dwd
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-15 19:11:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1887917, 1888812, 1888813    
Bug Blocks:    

Description Guilherme de Almeida Suckevicz 2020-10-15 18:56:32 UTC
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.

References:
https://github.com/hpcng/singularity/security/advisories/GHSA-7gcp-w6ww-2xv9
https://github.com/hpcng/singularity/blob/v3.6.4/CHANGELOG.md#security-related-fixes

Upstream patches:
https://github.com/hpcng/singularity/pull/5611
https://github.com/hpcng/singularity/commit/eba3dea260b117198fdb6faf41f2482ab2f8d53e

Comment 1 Guilherme de Almeida Suckevicz 2020-10-15 18:56:50 UTC
Created singularity tracking bugs for this issue:

Affects: epel-all [bug 1888813]
Affects: fedora-all [bug 1888812]

Comment 2 Dave Dykstra 2020-10-15 19:11:59 UTC

*** This bug has been marked as a duplicate of bug 1887917 ***