cap-std doesn't fully sandbox all the Windows device filenamesGHSA-hxf5-99xg-86hw
Fix: bytecodealliance/cap-std#371GHSA-hxf5-99xg-86hw is a Path Traversal vulnerability in cap-std. A fix is available for cap-std — 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-hxf5-99xg-86hw.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
cap-std🦀cap-async-std🦀cap-primitivesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Impact
cap-std's filesystem sandbox implementation on Windows blocks access to special device filenames such as "COM1", "COM2", "LPT0", "LPT1", and so on, however it did not block access to the special device filenames which use superscript digits, such as "COM¹", "COM²", "LPT⁰", "LPT¹", and so on. Untrusted filesystem paths could bypass the sandbox and access devices through those special device filenames with superscript digits, and through them provide access peripheral devices connected to the computer, or network resources mapped to those devices. This can include modems, printers, network printers, and any other device connected to a serial or parallel port, including emulated USB serial ports.
Patches
The bug is fixed in https://github.com/bytecodealliance/cap-std/pull/371, which is published in cap-primitives 3.4.1, cap-std 3.4.1, and cap-async-std 3.4.1.
Workarounds
There are no known workarounds for this issue. Affected Windows users are recommended to upgrade.
References
- Microsoft's documentation of the special device filenames
- ISO-8859-1
- https://github.com/bytecodealliance/cap-std/pull/371
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | cap-std | all versions | 3.4.1cargo update -p cap-std --precise 3.4.1 |
| 🦀crates.io | cap-async-std | all versions | 3.4.1cargo update -p cap-async-std --precise 3.4.1 |
| 🦀crates.io | cap-primitives | all versions | 3.4.1cargo update -p cap-primitives --precise 3.4.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for cap-std, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update cap-std to 3.4.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-hxf5-99xg-86hw 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-hxf5-99xg-86hw in your dependencies?
Find it across crates.io, including transitive dependencies.