Bypass incomplete fix of CVE-2024-27980
The fix for CVE-2024-27980 in Node.js on Windows was incomplete, so batch files with certain extensions could still be used to inject arbitrary commands through child_process.spawn or spawnSync. An attacker who controls a command-line argument could achieve code execution even when the shell option is disabled.
- Triaged in under an hour
- Fixed in 3 months
- Disclosed after 3 months
Summary by the program
The CVE-2024-27980 was identified as an incomplete fix for the BatBadBut vulnerability. This vulnerability arises from improper handling of batch files with all possible extensions on Windows via child_process.spawn / child_process.spawnSync. A malicious command line argument can inject arbitrary commands and achieve code execution even if the shell option is not enabled.
This vulnerability affects all users of child_process.spawn and child_process.spawnSync on Windows in all active release lines.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the fix for CVE-2024-27980 did not account for all batch file extensions, so Windows still treated certain files as batch scripts and allowed argument injection.
Impact
An attacker who can control a command-line argument could execute arbitrary commands on Windows, even when the shell option is not enabled.
What the attacker needed
Windows host; Node.js child_process.spawn or spawnSync; attacker controls a command-line argument
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program on Windows starts another program, it passes along arguments. If one of those arguments is controlled by an attacker, and the program being started is a batch file, the attacker can sneak extra commands into that argument. This report says the earlier fix for that problem did not cover every batch file extension, so the attack still worked.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.