Skip to content
RCE Disclosed report Intermediate CVE-2026-2780

Argument injection in the Copy as cURL for Windows allows arbitrary file read/write upon execution of the copied command

Firefox's 'Copy as cURL (Windows)' feature failed to properly escape backslashes, allowing an attacker to inject arbitrary cURL arguments via a crafted request. If a victim copies and executes the generated command, the attacker could read or write arbitrary files using cURL options like --output or --upload-file.

ryotak Follow

Originally disclosed on Mozilla

  • Fixed in 17 days
  • Paid in 25 days
  • Disclosed after 17 days

Created attachment 9534993 test.html

Summary

Firefox has a feature to copy the cURL command that reproduces the request sent in the browser. Two types of cURL commands can be generated on Windows; Windows and POSIX.

The Windows type of cURL command is expected to be executed in the command prompt, which has the separated parser from the cURL's argument parser (The one from Microsoft CRT).

To escape the request for both parsers, Firefox implements a complicated escape function in the following place:

https://searchfox.org/firefox-main/rev/5fcab02dad8c5bcae4c486d71b27f7e6a67e4d57/devtools/client/shared/curl.js#448-493

While it attempts to escape the string for the Microsoft CRT parser by replacing the " into \", it doesn't escape the \ character itself.

Therefore, by embedding the \" into the request, the above escape function escapes it into \\", which fails to escape the double quote character.

For example, if the request body is \" --help, it will generate the following command:

--data-raw "\\" --help "

Once the above command is parsed by cURL, it will recognize the --help argument and shows the help instead of sending the request.

Impact

An attacker who can trick the victim into copying the cURL command for a malicious request is able to inject arbitrary cURL arguments. By using the --output option or --upload-file option, an attacker can achieve arbitrary file read/write.

Steps to reproduce

This PoC will send the content of C:\Windows\win.ini to ryotak.net.

  1. Download test.html attached.
  2. Open it in the Firefox.
  3. Open DevTools and navigate to the Network tab.
  4. Click the Send a request button.
  5. Copy the request with Copy as cURL (Windows).
  6. Execute it in the command prompt and observe that the content of C:\Windows\win.ini is sent to ryotak.net.

Tested version

Firefox Nightly 148.0a1 (2025-12-27) (64-bit)

Windows 11 24H2 (OS Build 26100.4652)

The original report as published on Mozilla's Bugzilla, by RyotaK. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

The escape function for Windows cURL commands did not escape backslash characters, so a backslash followed by a double quote could break out of the quoted string and inject arguments.

Impact

An attacker who can trick the victim into copying the cURL command for a malicious request is able to inject arbitrary cURL arguments, potentially achieving arbitrary file read/write.

What the attacker needed

Victim uses Firefox on Windows; victim copies cURL command from malicious request; victim executes the copied command

How it was found

  1. Download the provided test.html file.
  2. Open it in Firefox.
  3. Open DevTools and go to the Network tab.
  4. Click the 'Send a request' button.
  5. Copy the request using 'Copy as cURL (Windows)'.
  6. Execute the copied command in the command prompt and observe that the content of C:\Windows\win.ini is sent to ryotak.net.

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 'Copy as cURL' in Firefox, it creates a command that should safely reproduce your request. However, a mistake in how Firefox handled backslashes meant that a malicious request could sneak in extra options to the cURL program. If you ran that command, those options could let an attacker read or write files on your computer.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by ryotak

View all

23 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.