Insufficient data validation in DevTools (CVE-2025-6557)
A bypass of a previously fixed issue in Chrome's DevTools 'Copy as cURL (cmd)' feature allows an attacker to inject newline characters into a request body, which when copied and pasted into Windows Command Prompt leads to arbitrary command execution. An attacker could execute arbitrary code on a victim's Windows machine if the victim copies the crafted request as a cURL command and runs it in cmd.
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
Steps to reproduce the problem
- Copy and run the payload in console (we can achieve it via html page too)
- Copy the request with copy as curl (windows)
- Paste on the windows cmd you can see calc triggers
Problem Description
HI Team, chrome latest on windows is vulnerable for code execution using copy as curl(cmd) which allows attacker to excute arbitrary code on victims (windows) machine
Issue ref: https://issues.chromium.org/issues/352651673 Similar issue was already reported to chrome and fixed (ref above) but now it was bypassed with my attached payload
Payload: fetch("https://example.com/postit", { "credentials": "omit", "headers": { "Accept-Language": "en-US", "Content-Type": "text/plain", }, "body": "query=evil\n\ncmd /c calc1.exe\t\r\t calc2.exe \t calc3.exe \rcalc.exe\rcalc.exe\r calc7.exe \rt\r\t calc2.exe \t calc3.exe \r", "method": "POST", });
I have attached the poc video for reference
Summary
Copy as Curl (CMD) Leads to code execution on windows
Custom Questions
Reporter credit:
Ameen Basha M K
Additional Data
Category: Security
Chrome Channel: Canary
Regression: N/A
Context
Google Chrome's DevTools includes a "Copy as cURL" feature that turns a network request into a cURL command line. On Windows, the generated command is intended to be pasted into cmd.exe. The report describes a bypass of an earlier fix for command injection in that feature, leading to arbitrary code execution on a Windows machine when the copied command is pasted into the Windows command prompt. The issue is tracked as CVE-2025-6557 and was disclosed on 24 June 2025 through the Chrome VRP, with a bounty of 1,000 USD and a severity of low. The weakness is insufficient data validation in DevTools.
Setup
The researcher used the latest Chrome on Windows, specifically the Canary channel. No accounts or special roles are mentioned. The only tools needed are the browser's DevTools console and the Windows command prompt. The precondition is that a victim copies a crafted request using "Copy as cURL (Windows)" and then pastes the result into cmd.exe.
Finding it
The researcher found that a request body containing newline and tab characters, copied as cURL and pasted into cmd, ran extra commands. The earlier issue, referenced as https://issues.chromium.org/issues/352651673, had already been reported and fixed, but the new payload bypassed that fix. The payload is a fetch call that sends a POST request with a text/plain body containing a query string followed by newlines, tabs and Windows commands.
Exploitation
Step 1: Run the payload in the console
The researcher copies and runs the following payload in the DevTools console. The report notes that the same effect can be achieved via an HTML page.
fetch("https://example.com/postit", {
"credentials": "omit",
"headers": {
"Accept-Language": "en-US",
"Content-Type": "text/plain",
},
"body": "query=evil\n\ncmd /c calc1.exe\t\r\t calc2.exe \t calc3.exe \rcalc.exe\rcalc.exe\r calc7.exe \rt\r\t calc2.exe \t calc3.exe \r",
"method": "POST",
});
The request is sent to https://example.com/postit with credentials omitted and a text/plain content type. The body begins with query=evil and then contains a sequence of newline (\n), carriage return (\r) and tab (\t) characters interleaved with Windows command names such as cmd /c calc1.exe, calc2.exe, calc3.exe, calc.exe and calc7.exe. These control characters are the core of the bypass: they cause extra commands to run when the copied command is pasted into cmd.exe.
Step 2: Copy the request as cURL
In the DevTools Network panel, the researcher uses "Copy as cURL (Windows)" on the request created in step 1. This produces a cURL command line that embeds the request body. The copied command, when pasted into cmd.exe, runs the commands embedded in the body.
Step 3: Paste into the Windows command prompt
The researcher pastes the copied command into cmd.exe. The report states that the calculator triggers, demonstrating code execution. The exact command line produced by "Copy as cURL" is not shown in the report; only the payload and the outcome are provided.
Root cause
The root cause is insufficient data validation in DevTools when generating a cURL command for Windows. The feature does not handle characters that are special to cmd.exe, such as newlines, carriage returns and tabs. The earlier fix for issue 352651673 did not cover the specific sequence used here, so the new payload bypassed it. The report does not describe the implementation of the fix or the exact escaping logic,
Impact
An attacker who can cause a victim to copy a crafted request as cURL and paste it into cmd.exe can execute arbitrary commands on the victim's Windows machine. The report demonstrates this with the Windows calculator. The attack requires user interaction: the victim must perform the copy and paste. The report does not state which Chrome versions are affected beyond "latest" and "Canary", nor does it provide a CVSS score. The severity assigned by the program is low.
Fix
The earlier issue was fixed, and this report describes a bypass of that fix. The report does not confirm whether such a fix was implemented.
Variants to test
- Try other control characters such as vertical tab, form feed or backspace in the request body, and check whether the generated cURL command still breaks out of the quoted argument when pasted into
cmd.exe. - Try different quoting contexts: place the payload in a header value, URL parameter or cookie, and observe whether "Copy as cURL" escapes it correctly.
- Try the same technique with PowerShell or other shells that DevTools may support for "Copy as cURL", and check whether the escaping differs.
- Test on different Chrome channels and versions to see whether the bypass is specific to Canary or affects stable as well.
Hunting notes
This kind of bug tends to hide in features that generate command lines or scripts from user-controlled data, especially when the target shell has its own quoting rules. During recon, look for "Copy as cURL", "Copy as PowerShell" or similar export features in developer tools, and check whether they properly escape newlines, tabs and shell metacharacters. To show enough impact, demonstrate code execution with a harmless command such as the calculator, and provide a clear step-by-step reproduction. The report was accepted with a low severity and a 1,000 USD bounty.
What happened, in plain words
Google Chrome has a set of tools for web developers built into the browser, called DevTools. One of its features, "Copy as cURL", takes a network request that the browser made and turns it into a line of text you can paste into a terminal to repeat that request. On Windows, that line is meant to be pasted into the Windows command prompt, cmd.exe.
The researcher found that if a request contains certain invisible control characters, such as line breaks and tabs, pasting the copied cURL command into cmd.exe runs extra commands. When a victim pastes that text into cmd.exe, the rest of the request body is run as separate Windows commands. In the demonstration, the Windows calculator opens.
This is a bypass of an earlier fix. A similar problem had already been reported and fixed (tracked at https://issues.chromium.org/issues/352651673), but the new payload got around that fix. The issue is tracked as CVE-2025-6557, was disclosed on 24 June 2025 through the Chrome VRP, has a severity of low, and earned a bounty of 1,000 USD. The weakness is insufficient data validation in DevTools.
Background: the pieces involved
Before walking through the steps, here is what each piece is, from zero.
- Chrome DevTools: a panel inside Chrome, opened with F12 or by right-clicking a page and choosing Inspect. It lets you look at the page's code, the network requests it makes, and run JavaScript in a console. Think of it as the engine room of the browser.
- Network panel: the part of DevTools that lists every request the page sends and receives, such as images, scripts and form submissions. Each entry can be right-clicked to get options, including "Copy as cURL".
- cURL: a command-line program for sending web requests. A cURL command is a line of text that says "send this request to this address with these headers and this body". It is a way to replay a request outside the browser.
cmd.exe: the classic Windows command prompt. You type commands into it and press Enter. It has its own rules about quotes and special characters, and it does not treat all characters the same way a browser does.- Request body: the data sent along with a request, for example the contents of a form. In a POST request, the body is where form fields usually go.
- Headers: extra labels attached to a request, such as the content type or the language. They tell the server how to interpret the request.
fetch: a JavaScript function built into browsers for sending network requests. Callingfetchin the DevTools console is the same as a page sending a request.- Control characters: characters that are not visible on screen but tell a program to do something, such as start a new line (
\n), return to the start of the line (\r) or move to the next tab stop (\t). In a command prompt, a newline means "run the command I just typed". - Command injection: a vulnerability where data that should be treated as plain text is instead interpreted as commands by a shell. The everyday comparison is a form where you write your name, and someone writes "John; delete everything" and the system runs the second part as an instruction.
- Insufficient data validation: the program accepts input without checking or neutralising characters that have special meaning later. Here, DevTools did not properly escape control characters when building the cURL command.
- Arbitrary code execution: the attacker can make the victim's computer run any command, not just the one demonstrated.
- CVE: a public identifier for a known security flaw, so people can refer to it unambiguously. CVE-2025-6557 is this one.
- Chrome VRP: Google's Vulnerability Reward Program, which pays researchers for reporting security bugs in Chrome.
- Canary channel: an early, experimental build of Chrome that gets new features before the stable release. Bugs found there may or may not affect the normal release.
Setup
The researcher used the latest Chrome on Windows, specifically the Canary channel. No accounts or special roles are mentioned. The only tools needed are the browser's DevTools console and the Windows command prompt. The precondition is that a victim copies a crafted request using "Copy as cURL (Windows)" and then pastes the result into cmd.exe.
Finding it
The researcher noticed that a request body containing newline and tab characters could break out of the quoted argument that DevTools generates for the cURL command. The earlier issue, referenced as https://issues.chromium.org/issues/352651673, had already been reported and fixed, but the new payload bypassed that fix. The payload is a fetch call that sends a POST request with a text/plain body containing a query string followed by newlines, tabs and Windows commands.
Exploitation
Step 1: Run the payload in the console
The researcher copies and runs the following payload in the DevTools console. The report notes that the same effect can be achieved via an HTML page.
fetch("https://example.com/postit", {
"credentials": "omit",
"headers": {
"Accept-Language": "en-US",
"Content-Type": "text/plain",
},
"body": "query=evil\n\ncmd /c calc1.exe\t\r\t calc2.exe \t calc3.exe \rcalc.exe\rcalc.exe\r calc7.exe \rt\r\t calc2.exe \t calc3.exe \r",
"method": "POST",
});
Line by line, in plain words:
fetch("https://example.com/postit", {starts a request to the addresshttps://example.com/postit. The{begins an object that describes the request. The address is a placeholder used in the report."credentials": "omit"tells the browser not to attach any stored credentials, such as cookies, to the request. Cookies are small pieces of data a site stores in your browser to remember you; omitting them keeps the request clean and avoids leaking a session."headers": {starts the list of headers."Accept-Language": "en-US"says the client prefers English (United States)."Content-Type": "text/plain"says the body is plain text, not a form or JSON."body": "query=evil\n\ncmd /c calc1.exe\t\r\t calc2.exe \t calc3.exe \rcalc.exe\rcalc.exe\r calc7.exe \rt\r\t calc2.exe \t calc3.exe \r"is the important part. It begins with the harmless textquery=evil, then contains a sequence of newline (\n), carriage return (\r) and tab (\t) characters mixed with Windows command names such ascmd /c calc1.exe,calc2.exe,calc3.exe,calc.exeandcalc7.exe. These control characters are the core of the bypass: they cause new commands to run when the command is pasted intocmd.exe."method": "POST"says this is a POST request, the kind normally used to submit data.});closes the object and the call.
Why this step: the researcher needs a request whose body contains the dangerous characters. Sending it from the console (or from an HTML page) creates exactly such a request in the Network panel, ready to be copied.
Step 2: Copy the request as cURL
In the DevTools Network panel, the researcher uses "Copy as cURL (Windows)" on the request created in step 1. This produces a cURL command line that embeds the request body. The copied command, when pasted into cmd.exe, runs the commands embedded in the body.
Why this step: the feature is the thing under test. The researcher wants to see what text Chrome produces when it turns the request into a command line, and whether that text is safe to paste.
Step 3: Paste into the Windows command prompt
The researcher pastes the copied command into cmd.exe. The report states that the calculator triggers, demonstrating code execution. The exact command line produced by "Copy as cURL" is not shown in the report; only the payload and the outcome are provided.
Why this step: pasting is what a normal user would do with a copied cURL command. If the pasted text runs extra commands, the feature has turned data into code.
Root cause
The root cause is insufficient data validation in DevTools when generating a cURL command for Windows. The feature does not handle characters that are special to cmd.exe, such as newlines, carriage returns and tabs. The earlier fix for issue 352651673 did not cover the specific sequence used here, so the new payload bypassed it. The report does not describe the implementation of the fix or the exact escaping logic,
Impact
An attacker who can cause a victim to copy a crafted request as cURL and paste it into cmd.exe can execute arbitrary commands on the victim's Windows machine. The report demonstrates this with the Windows calculator. The attack requires user interaction: the victim must perform the copy and paste. The report does not state which Chrome versions are affected beyond "latest" and "Canary", nor does it provide a CVSS score. The severity assigned by the program is low.
Fix
The earlier issue was fixed, and this report describes a bypass of that fix. The report does not confirm whether such a fix was implemented.
Variants to test
- Try other control characters such as vertical tab, form feed or backspace in the request body, and check whether the generated cURL command still breaks out of the quoted argument when pasted into
cmd.exe. - Try different quoting contexts: place the payload in a header value, URL parameter or cookie, and observe whether "Copy as cURL" escapes it correctly.
- Try the same technique with PowerShell or other shells that DevTools may support for "Copy as cURL", and check whether the escaping differs.
- Test on different Chrome channels and versions to see whether the bypass is specific to Canary or affects stable as well.
Hunting notes
This kind of bug tends to hide in features that generate command lines or scripts from user-controlled data, especially when the target shell has its own quoting rules. During recon, look for "Copy as cURL", "Copy as PowerShell" or similar export features in developer tools, and check whether they properly escape newlines, tabs and shell metacharacters. To show enough impact, demonstrate code execution with a harmless command such as the calculator, and provide a clear step-by-step reproduction. The report was accepted with a low severity and a 1,000 USD bounty.
Glossary
- API: a defined way for one program to talk to another, like a menu of requests a service accepts.
- Arbitrary code execution: the ability for an attacker to make a machine run any command they choose.
- Body: the data sent with a request, such as form contents.
- Bounty: a payment made by a company to a researcher who reports a valid security bug.
- Canary channel: an early Chrome build used for testing new features before they reach stable users.
cmd.exe: the classic Windows command prompt, where typed text is run as commands.- Command injection: a flaw where data meant as plain text is interpreted as commands by a shell.
- Control character: an invisible character that instructs a program, such as newline, carriage return or tab.
- Cookie: a small piece of data a site stores in the browser to remember state, such as a login session.
- cURL: a command-line tool for sending web requests, and the text form of a request it accepts.
- CVE: a public identifier for a known security vulnerability.
- CVSS: a scoring system for the severity of vulnerabilities.
- DevTools: the developer tools built into Chrome, including the console and network panel.
fetch: a JavaScript function for sending network requests from a browser.- Header: a label attached to a request or response that describes it, such as content type.
- Insufficient data validation: accepting input without checking or neutralising characters that have special meaning later.
- Network panel: the DevTools view that lists requests the page makes.
- POST: an HTTP method used to send data to a server, often form submissions.
- PowerShell: a more advanced Windows command-line shell and scripting language.
- Quoting: wrapping text in quotes so a shell treats it as one piece rather than as separate commands or arguments.
- Severity: a rating of how serious a vulnerability is, often low, medium, high or critical.
- Shell: a program that reads commands and runs them, such as
cmd.exeor PowerShell. - Stable: the normal release channel of Chrome used by most people.
- User interaction: a requirement that the victim do something, such as click, copy or paste, for an attack to work.
- VRP: Vulnerability Reward Program, a scheme that pays researchers for reporting bugs.