Closed Bug 2007829 (CVE-2026-2780) Opened 10 months ago Closed 9 months ago

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

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(firefox-esr115 unaffected, firefox-esr140148+ fixed, firefox147 wontfix, firefox148+ fixed, firefox149+ fixed)

RESOLVED FIXED
149 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 148+ fixed
firefox147 --- wontfix
firefox148 + fixed
firefox149 + fixed

People

(Reporter: ryotak.sec, Assigned: bomsy)

Details

(Keywords: csectype-priv-escalation, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main148+] [adv-esr140.8+])

Attachments

(1 file, 2 external files, 2 obsolete files)

515 bytes, text/html
Details
Attached file 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)

Flags: sec-bounty?
Component: Security → Netmonitor
Product: Firefox → DevTools
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Attached file (secure) β€”
Assignee: nobody → hmanilla
Status: NEW → ASSIGNED
Group: firefox-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

:bomsy, please add uplift requests when you have a moment. It grafts cleanly for ESR140 and Beta.

firefox-beta Uplift Approval Request

  • User impact if declined: Security vulnerability for devtools users
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Small JS string replace to escape slashes
  • String changes made/needed: None
  • Is Android affected?: no
Attachment #9537788 - Flags: approval-mozilla-beta?
Attached file (secure) β€”

Done. Thanks Donal.

Flags: needinfo?(hmanilla)
Attached file (secure) (obsolete) β€”
Attachment #9537789 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined: Security vulnerability for devtools users
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Small JS string replace to escape slashes
  • String changes made/needed: None
  • Is Android affected?: no
Attachment #9537788 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [sec] [uplift] [qa-triage-done-c149/b148]
Flags: sec-bounty? → sec-bounty+
Attached file (secure) (obsolete) β€”
Attachment #9540414 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined: Security vulnerability for devtools users
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Small JS string replace to escape slashes
  • String changes made/needed: None
  • Is Android affected?: no

Comment on attachment 9536600 [details]
(secure)

Approved for 140.8esr

Attachment #9536600 - Flags: approval-mozilla-esr140+
Attachment #9537789 - Attachment is obsolete: true
Attachment #9537789 - Flags: approval-mozilla-esr140?
Attachment #9540414 - Attachment is obsolete: true
Attachment #9540414 - Flags: approval-mozilla-esr140?
Whiteboard: [client-bounty-form] → [client-bounty-form][adv-main148+]
Whiteboard: [client-bounty-form][adv-main148+] → [client-bounty-form][adv-main148+] [adv-esr140.8+]
Alias: CVE-2026-2780
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: