Closed Bug 1998010 Opened 9 months ago Closed 8 months ago

Command Injection in "Copy as cURL (Windows)" feature via Nullbyte

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1997018

People

(Reporter: 0x999, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-priv-escalation, reporter-external, sec-moderate, Whiteboard: [client-bounty-form])

Attachments

(1 file)

Firefox's "Copy as cURL (Windows)" feature is vulnerable to a command injection vulnerability due to insufficient input sanitization.

The feature fails to sanitize the Nullbyte character in request data. While command separators (such as &) are correctly being escaped using a caret (^), when a nullbyte character is used before the separator the nullbyte character is also being escaped using a caret which results in the escaping character to be escaped and the & symbol to be interpreted as a command separator, using this an attacker can inject and execute arbitrary commands on the victim's system when the copied cURL command is pasted and executed in cmd.exe.

Steps to reproduce:

  1. Host the attached firefox_ci_nb.html file on your site or navigate to the one hosted on mine (https://0x999.net/pocs/firefox_ci_nb_5bbd343accb272c50f41e50544a0654e.html)
  2. Open devtools by right clicking on the page and click Inspect (or ctrl+shift+i) then select the Network tab
  3. Click on the click me button
  4. Right click the /copy-me request in the Network tab and select Copy Value -> Copy as cURL (Windows)
  5. Paste the copied command into your cmd and hit Enter to run it
  6. Observe calc.exe executing

POC:

<html>
<body>
<center><button onclick="x()">click me</button></center>
<script>
function x(){
fetch('/copy-me', {method:'POST', body:'\x00&calc.exe'})
}
</script>
</body>
</html>

Tested Firefox Version: 144.0.2 (64-bit) on Windows 10 Version 10.0.19045 Build 19045 as well as Windows 11

I've also attached a video POC

Flags: sec-bounty?
Component: Security → Netmonitor
Product: Firefox → DevTools
Blocks: curl
Severity: -- → S3
Priority: -- → P2

This would be fixed by Bug 1997018

Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Duplicate of bug: CVE-2025-14329
Resolution: --- → DUPLICATE
Flags: sec-bounty? → sec-bounty-
Group: firefox-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: