Rust advisories / cap-primitives
Vulnerability LowRUSTSEC-2024-0445 · cap-primitives
RUSTSEC-2024-0445: cap-primitives doesn't fully sandbox all the Windows device filenames
Short answerA security vulnerability in the cap-primitives crate: cap-primitives doesn't fully sandbox all the Windows device filenames. GitHub rates it Low. Fixed in 3.4.1: update to a fixed version.
| Crate | cap-primitives |
|---|---|
| Type | Vulnerability |
| Affected versions | Before 3.4.1. |
| Fixed in | 3.4.1 |
| Severity | Low (GitHub rating) CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
| Published | 2024-11-05 |
| Last changed | 2026-10-12 |
| Also known as | CVE-2024-51756, GHSA-hxf5-99xg-86hw |
What to do
- See which version you have:
cargo tree -i cap-primitives(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p cap-primitives. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplecap-primitives = "3.4.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Impact
cap-primitives'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 #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
- Package: crates.io/crates/cap-primitives
- Advisory: rustsec.org/advisories/RUSTSEC-2024-0445.html
- Web: github.com/bytecodealliance/cap-std/pull/371
- Web: github.com/bytecodealliance/cap-std/pull/371
- Web: nvd.nist.gov/vuln/detail/CVE-2024-51756
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?