Vulnerability in github.com/sylabs/singularity (CVE-2020-25040)
Summary
Vulnerability in github.com/sylabs/singularity (CVE-2020-25040). Successful exploitation can lead to full system takeover. Exploitable via TMPDIR. Mitigation: upgrade to 3.6.3 or later.
Original description
The description as published by the source.
Impact
Insecure permissions on temporary directories used in explicit and implicit container build operations.
When a Singularity command that results in a container build operation is executed, it is possible for a user with access to the system to read the contents of the image during the build. Additionally, if the image contains a world-writable file or directory, it is possible for a user to inject arbitrary content into the running build, which in certain circumstances may enable arbitrary code execution during the build and/or when the built container is run.
Patches
This issue is addressed in Singularity 3.6.3.
All users are advised to upgrade to 3.6.3.
Workarounds
The issue is mitigated if TMPDIR is set to a location that is only accessible to the user, as any subdirectories directly under TMPDIR cannot then be accessed by others. However, this is difficult to enforce so it is not recommended to rely on this as a mitigation.
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
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2020-25040 has been found in github.com/sylabs/singularity.
Attackers can target a specific entry point like TMPDIR over the network to misuse the product.
Successful exploitation can lead to full system takeover.
What to do: upgrade github.com/sylabs/singularity to 3.6.3 or later.
If unsure, ask your IT team or search "github.com/sylabs/singularity CVE-2020-25040" on the vendor's site.
CVE-2020-25040 (github.com/sylabs/singularity) — CWE-668
Attack vector: remote (network-reachable) / no user interaction
Attack surface: TMPDIR
Patched: 3.6.3 — apply immediately
Workaround: The issue is mitigated if TMPDIR is set to a location that is only accessible to the user, as any subdirectories directly under TMPDIR cannot then be accessed by others.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-668) exists in github.com/sylabs/singularity. Attackers reach the vulnerable code path via TMPDIR.
Check the vendor advisory for the affected versions of github.com/sylabs/singularity. Attack surface: TMPDIR.
Severity: ?. Successful exploitation can lead to full system takeover.
Update to 3.6.3.
Workaround: The issue is mitigated if TMPDIR is set to a location that is only accessible to the user, as any subdirectories directly under TMPDIR cannot then be accessed by others.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/sylabs/singularity' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/sylabs/singularity' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/sylabs/singularityを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
The issue is mitigated if `TMPDIR` is set to a location that is only accessible to the user, as any subdirectories directly under `TMPDIR` cannot then be accessed by others.パッチが適用されるまでの応急処置として、The issue is mitigated if
TMPDIRis set to a location that is only accessible to the user, as any subdirectories directly underTMPDIRcannot then be accessed by others. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade github.com/sylabs/singularity to 3.6.3ステージング環境で 3.6.3 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Ubuntu UBUNTU-CVE-2020-25040 singularity-container
References
- advisory nvd.nist.gov
- web github.com
- web medium.com
- web lists.opensuse.org
- web lists.opensuse.org