CVE-2020-15229
📋 TL;DR
This CVE allows path traversal attacks during squashfs extraction in Singularity container platform. Attackers can overwrite/create arbitrary files on the host filesystem using malicious container images. Affects users running Singularity in unprivileged mode or building images from remote sources.
💻 Affected Systems
- Singularity (now Apptainer)
📦 What is this software?
Backports Sle by Opensuse
Leap by Opensuse
Leap by Opensuse
⚠️ Risk & Real-World Impact
Worst Case
Root user building images could have arbitrary files overwritten, leading to full system compromise including privilege escalation, backdoor installation, or data destruction.
Likely Case
Unprivileged users could overwrite files they have write access to, potentially escalating privileges or disrupting system operations.
If Mitigated
With proper controls, impact limited to isolated container environments with restricted filesystem access.
🎯 Exploit Status
Exploitation requires user to run or build from a malicious container image. The vulnerability is in the unsquashfs extraction process during image handling.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.6.4
Vendor Advisory: https://github.com/hpcng/singularity/blob/v3.6.4/CHANGELOG.md#security-related-fixes
Restart Required: No
Instructions:
1. Check current version: singularity version
2. Upgrade to 3.6.4 or later using package manager or source
3. For package install: sudo apt/yum update singularity
4. For source install: git clone, checkout v3.6.4+, make, sudo make install
🔧 Temporary Workarounds
Avoid unprivileged single file images
linuxUse sandbox images instead of single file images in unprivileged mode
singularity build --sandbox image.sandbox docker://alpine
Restrict image build sources
linuxAvoid building images from library:// and shub:// sources
Use local images or docker:// sources instead
🧯 If You Can't Patch
- Disable unprivileged mode and require setuid (set allow setuid = yes in singularity.conf)
- Use --fakeroot flag for image building or perform builds in isolated VMs
🔍 How to Verify
Check if Vulnerable:
Check if running version 3.1.1 through 3.6.3: singularity version | grep -E '3\.[1-5]\.[0-9]+|3\.6\.[0-3]'
Check Version:
singularity version
Verify Fix Applied:
Confirm version is 3.6.4 or later: singularity version | grep -E '3\.6\.[4-9]|3\.[7-9]\.[0-9]+|[4-9]\.[0-9]+\.[0-9]+'
📡 Detection & Monitoring
Log Indicators:
- Failed file overwrite attempts in system logs
- Unexpected file modifications during container operations
- Singularity processes extracting from library:// or shub:// sources
Network Indicators:
- Downloads from library.sylabs.io or Singularity Hub during image operations
SIEM Query:
process.name:"singularity" AND (network.destination:"library.sylabs.io" OR network.destination:"singularity-hub.org")
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00070.html
- http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00071.html
- http://lists.opensuse.org/opensuse-security-announce/2020-11/msg00009.html
- https://github.com/hpcng/singularity/blob/v3.6.4/CHANGELOG.md#security-related-fixes
- https://github.com/hpcng/singularity/commit/eba3dea260b117198fdb6faf41f2482ab2f8d53e
- https://github.com/hpcng/singularity/pull/5611
- https://github.com/hpcng/singularity/security/advisories/GHSA-7gcp-w6ww-2xv9
- http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00070.html
- http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00071.html
- http://lists.opensuse.org/opensuse-security-announce/2020-11/msg00009.html
- https://github.com/hpcng/singularity/blob/v3.6.4/CHANGELOG.md#security-related-fixes
- https://github.com/hpcng/singularity/commit/eba3dea260b117198fdb6faf41f2482ab2f8d53e
- https://github.com/hpcng/singularity/pull/5611
- https://github.com/hpcng/singularity/security/advisories/GHSA-7gcp-w6ww-2xv9