Skip to content
RCE Disclosed report Intermediate CVE-2025-5265

Copy As Curl (Posix) - Code Execution - Headers

The 'Copy as cURL' feature in Firefox did not properly sanitise HTTP header values, allowing an attacker to inject shell commands. When a victim copied a crafted request as a cURL command and pasted it into a Windows command prompt, the injected command executed.

Ameen Basha M K Follow

Originally disclosed on Mozilla

  • Fixed in 5 days
  • Paid in 7 days
  • Disclosed after 5 days
Text
Created attachment 9480766
Firefox-CopyAsCurl(Posix)-Headers-CodeExec.mp4

HI Team, While testing the copy as curl - code execution issues fix in latest nightly it was found that headers are unsanitized and still vulnerable for Code execution on windows machine

Tested in latest nightly 139.0a1 (2025-04-23) (64-bit) on windows

'''js
fetch('', {method: 'temp',headers: {
'Temp': '&calc.exe&'
}});
'''

Steps to reproduce
1. Send the above request directly via console (or) embed it in html
2. Now from network tab copy the request as curl
3. paste it in cmd and you can find the calc popup

I have attached the poc video for reference

The original report as published on Mozilla's Bugzilla, by Ameen Basha M K. 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

Likely, the code that generates the cURL command did not escape or quote header values, so shell metacharacters in a header value were interpreted as commands when the generated command was pasted into a shell.

Impact

An attacker could execute arbitrary commands on a victim's Windows machine if the victim copies a crafted request as cURL and pastes it into a command prompt.

What the attacker needed

Victim uses Firefox on Windows; victim copies request as cURL; victim pastes into cmd

How it was found

  1. Send a request with a malicious header value via the browser console or an HTML page.
  2. In the Network tab, copy the request as cURL.
  3. Paste the copied command into a Windows command prompt, which triggers the calculator to open.

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 the 'Copy as cURL' option in a browser's developer tools, it creates a text command that you can paste into a terminal to repeat the request. This report shows that if a website sends a special header value, that text command can include extra commands that run on your computer when you paste it. The attacker doesn't need to hack the browser directly; they just need you to copy and paste the generated command.

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 Ameen Basha M K

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.