GHSA-hxf5-99xg-86hw
cap-std doesn't fully sandbox all the Windows device filenames
Details
### 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](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) of the special device filenames - [ISO-8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) - https://github.com/bytecodealliance/cap-std/pull/371
Are you affected?
Enter the version of the package you're using.
Affected packages
0Fixed in: 3.4.1Upgrade cap-std to 3.4.1 or newer (ecosystem crates.io).
0Fixed in: 3.4.1Upgrade cap-async-std to 3.4.1 or newer (ecosystem crates.io).
0Fixed in: 3.4.1Upgrade cap-primitives to 3.4.1 or newer (ecosystem crates.io).
References
- https://github.com/bytecodealliance/cap-std/security/advisories/GHSA-hxf5-99xg-86hw[WEB]
- https://nvd.nist.gov/vuln/detail/CVE-2024-51756[ADVISORY]
- https://github.com/bytecodealliance/cap-std/pull/371[WEB]
- https://github.com/bytecodealliance/cap-std/commit/dcc3818039761331fbeacbb3a40c542b65b5ebf7[WEB]
- https://en.wikipedia.org/wiki/ISO/IEC_8859-1[WEB]
- https://github.com/bytecodealliance/cap-std[PACKAGE]
- https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions[WEB]
- https://rustsec.org/advisories/RUSTSEC-2024-0445.html[WEB]