Copy As Curl (Windows) - Code Execution via body \n injection
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(firefox-esr115 wontfix, firefox-esr140146+ fixed, firefox145 wontfix, firefox146+ fixed, firefox147+ fixed)
People
(Reporter: ameenbasha111, Assigned: bomsy)
References
(Blocks 1 open bug)
Details
(Keywords: csectype-priv-escalation, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main146+][adv-esr140.6+])
Attachments
(3 files)
|
2.56 MB,
video/mp4
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
Hi Team, Firefox latest on windows is vulnerable for code execution via copy as curl (windows) feature on windows, which allows attacker to execute arbitrary command on victim machine
Payload:
fetch("/", {
"credentials": "omit",
"headers": {
"Accept-Language": "en-US",
"Content-Type": "text/plain",
},
"body": '\t \rcalc.exe "\t \n',
"method": "POST",
});
Note: It also have impact of sharing LOCAL FILE NAME with attacker by using consecutive tab chaarcters
Steps to reproduce:
- Send the above request directly via console (or) embed it in html
- Now from network tab copy the request as curl
- paste it in cmd and you can find the calc popup
Tested in Nightly 146.0a1 (2025-10-27) (64-bit) on windows 11 pro
I have attached the poc video too for reference
| Reporter | ||
Comment 1•7 months ago
|
||
Root cause is when " is used it is escaped with ^ character so " become => ^" and immediate usage of \t include the local file name which will enclose with " and we can free to use \n (or) \r to break to new line and execute Code
- Impact: Code Execution
- Local File Names Disclosure (Complete Directory file names disclosure to attacker)
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 2•7 months ago
|
||
Updated•7 months ago
|
Comment 4•7 months ago
|
||
Comment 5•7 months ago
|
||
The patch landed in nightly and beta is affected.
:bomsy, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox146towontfix.
For more information, please visit BugBot documentation.
Comment 6•7 months ago
|
||
:bomsy, to add to Comment 5, this will also need an uplift request for ESR140. It grafts cleanly with Bug 1997018 applied.
Updated•6 months ago
|
Comment 7•6 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: With clever combinations which would include certain whitespace-like characters in the curl commands apps on user local machine can be executed.
- 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 patch with regexp to escape the whitespace-like characters.
- String changes made/needed: None
- Is Android affected?: no
| Assignee | ||
Comment 8•6 months ago
|
||
Certain control characters (e.g tab or form feed) are whitespace like characters.
This replaces those with a simple space.
Original Revision: https://phabricator.services.mozilla.com/D272425
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 9•6 months ago
|
||
Comment on attachment 9526438 [details]
(secure)
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: With clever combinations which would include certain whitespace-like characters in the curl commands apps on user local machine can be executed.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Small js patch with regexp to escape the whitespace-like characters.
- String changes made/needed: None
- Is Android affected?: No
| Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 10•6 months ago
|
||
Comment on attachment 9526438 [details]
(secure)
Approved for 146.0b9
Comment 11•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 12•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•25 days ago
|
Description
•