CVEMETERBack to radar
OFFICIAL RECORD · Rust

CVE-2024-24576

PUBLISHEDOfficial status check: verifiedCVSS 3.1: 10 · critical

Rusts's `std::process::Command` did not properly escape arguments of batch files on Windows

Rust is a programming language. The Rust Security Response WG was notified that the Rust standard library prior to version 1.77.2 did not properly escape arguments when invoking batch files (with the `bat` and `cmd` extensions) on Windows using the `Command`. An attacker able to control the arguments passed to the spawned process could execute arbitrary shell commands by bypassing the escaping. The severity of this vulnerability is critical for those who invoke batch files on Windows with untrusted arguments. No other platform or use is affected. The `Command::arg` and `Command::args` APIs state in their documentation that the arguments will be passed to the spawned process as-is, regardless of the content of the arguments, and will not be evaluated by a shell. This means it should be safe to pass untrusted input as an argument. On Windows, the implementation of this is more complex than other platforms, because the Windows API only provides a single string containing all the arguments to the spawned process, and it's up to the spawned process to split them. Most programs use the standard C run-time argv, which in practice results in a mostly consistent way arguments are splitted. One exception though is `cmd.exe` (used among other things to execute batch files), which has its own argument splitting logic. That forces the standard library to implement custom escaping for arguments passed to batch files. Unfortunately it was reported that our escaping logic was not thorough enough, and it was possible to pass malicious arguments that would result in arbitrary shell execution. Due to the complexity of `cmd.exe`, we didn't identify a solution that would correctly escape arguments in all cases. To maintain our API guarantees, we improved the robustness of the escaping code, and changed the `Command` API to return an `InvalidInput` error when it cannot safely escape an argument. This error will be emitted when spawning the process. The fix is included in Rust 1.77.2. Note that the new escaping logic for batch files errs on the conservative side, and could reject valid arguments. Those who implement the escaping themselves or only handle trusted inputs on Windows can also use the `CommandExt::raw_arg` method to bypass the standard library's escaping logic.

Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.

Severity and exploitation evidence

EPSS: 20.342% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.

CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:59:58.648Z. Public exploit availability is not used to set this status.

CVSS 3.1 · 10 · published by GitHub_M
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Assessment source · checked 2026-11-19T12:57:06.464Z

CVSS 3.1 · 10 · published by Ubuntu Security
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Assessment source · checked 2026-11-19T16:51:15.805Z

Verification by field

FieldStatusChecked at (UTC)Source
kevverified2026-11-19T17:59:58.648ZCISA KEV
cvssverified2026-11-19T12:57:06.464ZCVE Program
epssverified2026-11-19T16:04:37.769ZFIRST EPSS
patchesunknownunknownunknown
affectedverified2026-11-19T12:57:06.464ZCVE Program
lifecycleverified2026-11-19T12:57:06.464ZCVE Program

Affected versions and configuration

rust-lang rust; default status: unknown: < 1.77.2 [affected; scheme: unspecified]

Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.

Ubuntu Security · ubuntu-package · full conditions
[
  {
    "name": "rustc",
    "debian": "https://tracker.debian.org/pkg/rustc",
    "source": "https://ubuntu.com/security/cve?package=rustc",
    "ubuntu": "https://packages.ubuntu.com/search?suite=all&section=all&arch=any&searchon=sourcenames&keywords=rustc",
    "statuses": [
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "trusty"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "xenial"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "bionic"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "focal"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "jammy"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "only affects rustc on Windows",
        "release_codename": "mantic"
      },
      {
        "pocket": "security",
        "status": "not-affected",
        "component": null,
        "description": "debian: Only affects rustc on Windows",
        "release_codename": "upstream"
      }
    ]
  }
]
Archived source JSON
CVE Program · cve-json · full conditions
{
  "affected": [
    {
      "vendor": "rust-lang",
      "product": "rust",
      "versions": [
        {
          "status": "affected",
          "version": "< 1.77.2"
        }
      ]
    }
  ],
  "additionalContainers": [
    {
      "title": "CISA ADP Vulnrichment",
      "metrics": [
        {
          "other": {
            "type": "ssvc",
            "content": {
              "id": "CVE-2024-24576",
              "role": "CISA Coordinator",
              "options": [
                {
                  "Exploitation": "poc"
                },
                {
                  "Automatable": "yes"
                },
                {
                  "Technical Impact": "total"
                }
              ],
              "version": "2.0.3",
              "timestamp": "2025-02-26T18:38:35.986544Z"
            }
          }
        }
      ],
      "affected": [
        {
          "cpes": [
            "cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:*"
          ],
          "vendor": "rust-lang",
          "product": "rust",
          "versions": [
            {
              "status": "affected",
              "version": "0",
              "lessThan": "1.77.2",
              "versionType": "semver"
            }
          ],
          "defaultStatus": "affected"
        }
      ],
      "providerMetadata": {
        "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "shortName": "CISA-ADP",
        "dateUpdated": "2025-02-26T18:38:58.221Z"
      }
    },
    {
      "title": "CVE Program Container",
      "references": [
        {
          "url": "https://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh",
          "name": "https://github.com/rust-lang/rust/security/advisories/GHSA-q455-m56c-85mh",
          "tags": [
            "x_refsource_CONFIRM",
            "x_transferred"
          ]
        },
        {
          "url": "https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput",
          "name": "https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://doc.rust-lang.org/std/os/windows/process/trait.CommandExt.html#tymethod.raw_arg",
          "name": "https://doc.rust-lang.org/std/os/windows/process/trait.CommandExt.html#tymethod.raw_arg",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://doc.rust-lang.org/std/process/struct.Command.html",
          "name": "https://doc.rust-lang.org/std/process/struct.Command.html",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://doc.rust-lang.org/std/process/struct.Command.html#method.arg",
          "name": "https://doc.rust-lang.org/std/process/struct.Command.html#method.arg",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://doc.rust-lang.org/std/process/struct.Command.html#method.args",
          "name": "https://doc.rust-lang.org/std/process/struct.Command.html#method.args",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://github.com/rust-lang/rust/issues",
          "name": "https://github.com/rust-lang/rust/issues",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://www.rust-lang.org/policies/security",
          "name": "https://www.rust-lang.org/policies/security",
          "tags": [
            "x_refsource_MISC",
            "x_transferred"
          ]
        },
        {
          "url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/W7WRFOIAZXYUPGXGR5UEEW7VTTOD4SZ3/",
          "tags": [
            "x_transferred"
          ]
        },
        {
          "url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/RPH3PF7DVSS2LVIRLW254VWUPVKJN46P/",
          "tags": [
            "x_transferred"
          ]
        },
        {
          "url": "https://lists.fedoraproject.org/archives/list/[email protected]/message/N323QAEEUVTJ354BTVQ7UB6LYXUX2BCL/",
          "tags": [
            "x_transferred"
          ]
        },
        {
          "url": "http://www.openwall.com/lists/oss-security/2024/04/09/16",
          "tags": [
            "x_transferred"
          ]
        },
        {
          "url": "https://www.kb.cert.org/vuls/id/123335"
        }
      ],
      "providerMetadata": {
        "orgId": "af854a3a-2127-422b-91ae-364da2661108",
        "shortName": "CVE",
        "dateUpdated": "2025-11-04T18:29:08.712Z"
      }
    }
  ]
}
Archived source JSON

Correction evidence

Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.

No correction has been verified in the connected records. This does not mean the system is secure or that no vendor correction exists.

Vendor notices and operational guidance

No connected vendor notice is available for this record.

Original sources and dates

Official status history