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

[Mac] Copy as powershell (on curl) leads to code execution on mac

Firefox's 'Copy as PowerShell' feature failed to escape the HTTP method when generating a curl command, so a malicious method containing shell metacharacters could inject commands. An attacker who tricks a user into copying a request as PowerShell and running it could achieve code execution on the user's machine.

Ameen Basha M K Follow

Originally disclosed on Mozilla

  • Fixed in 8 days
  • Paid in 13 days
  • Disclosed after 8 days
Text
HI team, Firefox latest on mac is vulnerable for code execution, which allows the attacker to trick the user with malicious request to copy as powershell and run it on mac leads to code execution

Note: HTTP method is vulnerable part of the resultant curl.

FYI: we can install the powershell in mac via homebrew (instead of moving to windows, i have used this to run powershell command on mac) - Same possible on directly running in windows powershell too

Fetch Command: (run it on console)
fetch('',{method: '||whoami||'});

Steps to reproduce
1. run the above command in browser console (we can achieve this via html file itself)
2. copy the request as powershell
3. paste and run it on powershell
4. you can see the output of whoami command

Note: Issue tested on latest version of firefox

I will attached the poc video for reference shortly

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

What the attacker needed

Victim uses Firefox on Mac; victim copies request as PowerShell; victim runs the copied command

How it was found

  1. Run a fetch command in the browser console with a malicious HTTP method.
  2. Copy the request as PowerShell.
  3. Paste and run it in PowerShell.
  4. Observe the output of the injected command.

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 copy a network request as a PowerShell command, Firefox builds a command line that includes the request's HTTP method. If that method contains special characters, they can break out of the intended command and run extra commands. An attacker could make a request with a malicious method, and if you copy it and run it, their commands execute 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 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.