CVE-2024-51756: Cap std Cap-std Doesn't Fully Sandbox All Vulnerability

LOW
Advisory Identifier: GHSA-hxf5-99xg-86hw
CWE-22
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-51756
GHSA Identifier GHSA-hxf5-99xg-86hw
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Cap std
Package Ecosystem crates.io
Published Date
Last Updated

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.

cap-std fixed: 3.4.1
Upgrade cap-std to 3.4.1
cap-async-std fixed: 3.4.1
Upgrade cap-async-std to 3.4.1
cap-primitives fixed: 3.4.1
Upgrade cap-primitives to 3.4.1
Verify Direct and Transitive Dependencies

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

### 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

CVE-2024-51756 Affected Cap std Versions

3 component(s)
Fixed Versions:
3.4.1
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?
CVE-2024-51756 is a security vulnerability in Cap std involving cap-std doesn't fully sandbox all the Windows device filenames under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Cap std versions are affected?
Affected versions include releases prior to 3.4.1 across affected packages: cap-std, cap-async-std, cap-primitives.
What version fixes CVE-2024-51756?
Upgrading to 3.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cap-std affected?
Yes, cap-std is affected in releases prior to 3.4.1. Upgrade your dependency to 3.4.1 or later.
Is cap-async-std affected?
Yes, cap-async-std is affected in releases prior to 3.4.1. Upgrade your dependency to 3.4.1 or later.
What CWE is associated with CVE-2024-51756?
CVE-2024-51756 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check crates.io dependencies for CVE-2024-51756?
Run the dependency tree command: 'inspect dependencies for cap-std'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}