melange has a path traversal in license-path which allows reading files outside workspaceGHSA-2w4f-9fgg-q2v9
MEDIUMFix: chainguard-dev/melange@2f95c9fGHSA-2w4f-9fgg-q2v9 is a medium-severity (CVSS 5.5) Path Traversal vulnerability in chainguard.dev/melange. A fix is available for chainguard.dev/melange — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-2w4f-9fgg-q2v9.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
chainguard.dev/melangeReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
An attacker who can influence a melange configuration file (e.g., through pull request-driven CI or build-as-a-service scenarios) could read arbitrary files from the host system. The LicensingInfos function in pkg/config/config.go reads license files specified in copyright[].license-path without validating that paths remain within the workspace directory, allowing path traversal via ../ sequences. The contents of the traversed file are embedded into the generated SBOM as license text, enabling exfiltration of sensitive data through build artifacts.
Fix: Merged in commit 2f95c9f4
Acknowledgements
melange thanks Oleh Konko (@1seal) from 1seal for discovering and reporting this issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | chainguard.dev/melange | ≥ 0.14.0&&< 0.40.3 | 0.40.3go get chainguard.dev/melange@v0.40.3 |
Affected Products
melangechainguardDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for chainguard.dev/melange, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update chainguard.dev/melange to 0.40.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2w4f-9fgg-q2v9 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is GHSA-2w4f-9fgg-q2v9 in your dependencies?
Find it across Go, including transitive dependencies.