CVE-2024-51756 cap-std doesn't fully sandbox all the Windows device filenames

Low 2.3 Published Updated

Attackers can bypass filesystem sandboxing on Windows using special device filenames with superscript digits to access peripheral devices or network resources.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-51756?

CVE-2024-51756 is a low-severity path traversal vulnerability in bytecodealliance cap-std, published on 5 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

The cap-std project is organized around the eponymous `cap-std` crate, and develops libraries to make it easy to write capability-based code. 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. 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. There are no known workarounds for this issue. Affected Windows users are recommended to upgrade.

Weakness: CWE-22

Which versions are affected by CVE-2024-51756?

7 open source packages ship an affected version, including cap-std, cap-async-std and cap-primitives.

PackageAffectedFixed in
cap-std crates.ioAll versions3.4.1
cap-std crates.ioAll versions3.4.1
cap-async-std crates.ioAll versions3.4.1
cap-async-std crates.ioAll versions3.4.1
cap-primitives crates.ioAll versions3.4.1
cap-primitives crates.ioAll versions3.4.1
1 more packages
cap-primitives crates.ioFrom 0.0.0-03.4.1

How do I fix CVE-2024-51756?

Upgrade cap-std to 3.4.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-51756 being exploited?

There is no known exploitation of CVE-2024-51756 in the wild and no public exploit code.

Sources

Also known as GHSA-hxf5-99xg-86hw, RUSTSEC-2024-0445.

Is CVE-2024-51756 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free