CVE-2024-51756: Cap std Cap-std Doesn't Fully Sandbox All Vulnerability
LOWCVE-2024-51756 is a LOW cap-std doesn't fully sandbox all vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Cap std libraries in the crates.io ecosystem. The issue involves cap-std doesn't fully sandbox all the windows device filenames. Remediation is available by upgrading affected packages to version 3.4.1.
CVE-2024-51756 at a Glance
How to Fix CVE-2024-51756
To remediate this vulnerability, upgrade all affected Cap std dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade cap-std to 3.4.1
Upgrade cap-async-std to 3.4.1
Upgrade cap-primitives to 3.4.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for cap-std
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-51756, inspect your project dependencies for Cap std:
inspect dependencies for cap-std
Analyze the terminal output to locate any version of Cap std in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Cap std, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-51756 Affected Cap std Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cap-std
|
crates.io |
< 3.4.1
|
3.4.1
|
|
cap-async-std
|
crates.io |
< 3.4.1
|
3.4.1
|
|
cap-primitives
|
crates.io |
< 3.4.1
|
3.4.1
|
References
Frequently Asked Questions
What is CVE-2024-51756?
Which Cap std versions are affected?
What version fixes CVE-2024-51756?
Is cap-std affected?
Is cap-async-std affected?
What CWE is associated with CVE-2024-51756?
How can I check crates.io dependencies for CVE-2024-51756?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hxf5-99xg-86hw",
"modified" : "2025-12-20T05:46:02Z",
"published" : "2024-11-05T22:19:59Z",
"aliases" : [ "CVE-2024-51756" ],
"summary" : "cap-std doesn't fully sandbox all the Windows device filenames",
"details" : "### Impact\n\ncap-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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nThere are no known workarounds for this issue. Affected Windows users are recommended to upgrade.\n\n### References\n\n - [Microsoft's documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) of the special device filenames\n - [ISO-8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)\n - https://github.com/bytecodealliance/cap-std/pull/371",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "cap-std"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "cap-async-std"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "cap-primitives"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/bytecodealliance/cap-std/security/advisories/GHSA-hxf5-99xg-86hw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-51756"
}, {
"type" : "WEB",
"url" : "https://github.com/bytecodealliance/cap-std/pull/371"
}, {
"type" : "WEB",
"url" : "https://github.com/bytecodealliance/cap-std/commit/dcc3818039761331fbeacbb3a40c542b65b5ebf7"
}, {
"type" : "WEB",
"url" : "https://en.wikipedia.org/wiki/ISO/IEC_8859-1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bytecodealliance/cap-std"
}, {
"type" : "WEB",
"url" : "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0445.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-05T22:19:59Z",
"nvd_published_at" : "2024-11-05T22:15:21Z"
}
}