{"answers":{"affected":"It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-43402 in the wild and no public exploit code.","fix":"No fix has been published for CVE-2024-43402 yet. Limit exposure of the affected software until one is available.","what":"CVE-2024-43402 is a high-severity command injection vulnerability in rust-lang rust, published on 4 Sep 2024. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-43402 and fix it if it is affected.\n\nWhat it is: CVE-2024-43402 is a high-severity command injection vulnerability in rust-lang rust, published on 4 Sep 2024. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-43402 in the wild and no public exploit code.\n\nAffected product: rust-lang rust. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-43402/ (Markdown: https://insights.sbomify.com/CVE-2024-43402/index.md)","id":"CVE-2024-43402","markdown":"https://insights.sbomify.com/CVE-2024-43402/index.md","name":"CVE-2024-43402","record":{"aliases":["GHSA-2xg3-7mm6-98jj"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Rust standard library","requires_auth":"none","summary":"Attackers can execute arbitrary commands on Windows by exploiting incomplete argument escaping in Rust's process invocation when batch file names contain trailing whitespace or periods.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"rust","vendor":"rust-lang"}],"cvss":{"score":8.2,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-88","name":"Improper Neutralization of Argument Delimiters in a Command"},{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"description":"Rust is a programming language. The fix for CVE-2024-24576, where `std::process::Command` incorrectly escaped arguments when invoking batch files on Windows, was incomplete. Prior to Rust version 1.81.0, it was possible to bypass the fix when the batch file name had trailing whitespace or periods (which are ignored and stripped by Windows). To determine whether to apply the `cmd.exe` escaping rules, the original fix for the vulnerability checked whether the command name ended with `.bat` or `.cmd`. At the time that seemed enough, as we refuse to invoke batch scripts with no file extension. Windows removes trailing whitespace and periods when parsing file paths. For example, `.bat. .` is interpreted by Windows as `.bat`, but the original fix didn't check for that. Affected users who are using Rust 1.77.2 or greater can remove the trailing whitespace (ASCII 0x20) and trailing periods (ASCII 0x2E) from the batch file name to bypass the incomplete fix and enable the mitigations. Users are affected if their code or one of their dependencies invoke a batch script on Windows with trailing whitespace or trailing periods in the name, and pass untrusted arguments to it. Rust 1.81.0 will update the standard library to apply the CVE-2024-24576 mitigations to all batch files invocations, regardless of the trailing chars in the file name.","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":false,"headline":"Rust OS Command Injection/Argument Injection vulnerability","id":"CVE-2024-43402","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"command_injection","year":"2024"},"n_packages":0,"n_references":3,"next":{"headline":"Kanister has a potential risk which can be leveraged to make a cluster-level privilege escalation","id":"CVE-2024-43403"},"packages":[],"prev":{"headline":"In XWiki Platform, payloads stored in content is executed when a user with script/programming right edit them","id":"CVE-2024-43401"},"products":["rust"],"published":"2024-09-04","related":[{"cvss_score":9.8,"headline":"Use after free in n/a","id":"CVE-2020-36318","kev_date_added":null,"published":"2021-04-11"},{"cvss_score":9.8,"headline":"Integer overflow in n/a","id":"CVE-2018-1000810","kev_date_added":null,"published":"2018-10-08"},{"cvss_score":9.1,"headline":"Security feature bypass in n/a","id":"CVE-2021-29922","kev_date_added":null,"published":"2021-08-07"},{"cvss_score":7.8,"headline":"Memory corruption in n/a","id":"CVE-2018-1000657","kev_date_added":null,"published":"2018-08-20"},{"cvss_score":7.8,"headline":"Other in n/a","id":"CVE-2018-1000622","kev_date_added":null,"published":"2018-07-09"},{"cvss_score":7.5,"headline":"Memory corruption in n/a","id":"CVE-2015-20001","kev_date_added":null,"published":"2021-04-11"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-09-04","vendors":["rust-lang"]},"summary":"Attackers can execute arbitrary commands on Windows by exploiting incomplete argument escaping in Rust's process invocation when batch file names contain trailing whitespace or periods.","url":"https://insights.sbomify.com/CVE-2024-43402/"}