Skip to content
RCE Advisory Intermediate CVE-2025-12907

Insufficient validation of untrusted input in Devtools (CVE-2025-12907)

The DevTools 'Copy as cURL (cmd)' feature on Windows failed to sanitise tab characters, allowing an attacker to inject command separators and execute arbitrary commands when the copied text is pasted into a command prompt. This bypassed a previous fix that only addressed newline characters.

Ameen Basha M K Follow

Originally disclosed on Chrome VRP

Bounty$1,500 Low View original
  • Fix shipped in 2 months

Steps to reproduce the problem

  1. Open the poc html in chrome
  2. open network teab and copy the requests with - copy all as curl (cmd) feature
  3. paste the command on cmd you can see the calc popup

Problem Description

A command injection vulnerability exists in the DevTools "Copy as cURL (cmd)" feature on Windows. The current implementation correctly handles carriage returns (\r) but fails to sanitize the tab character (\t).

The cmd.exe shell interprets the tab character as a delimiter, similar to a space. By injecting a payload containing a tab followed by a command separator (e.g., &) and a newline sequence, an attacker can break out of the intended cURL argument and execute arbitrary commands when the copied text is pasted into a Windows command prompt.

This is a bypass of a previous security fix that only addressed newline characters.

Additional Comments

Security Impact: This vulnerability allows for arbitrary code execution on a user's machine. If a user is tricked into pasting a crafted cURL command from a malicious source, the attacker can execute commands with the user's privileges.

Note: I have attached the poc video and html file for reference

Summary

Command injection in "Copy as cURL (cmd)" due to improper sanitization

Custom Questions

Reporter credit:

Ameen Basha M K

Additional Data

Category: Security
Chrome Channel: Canary
Regression: N/A \

The original report as published on the Chromium issue tracker, by Ameen Basha M K. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Chrome DevTools includes a Network panel feature called "Copy as cURL (cmd)". When a developer selects one or more requests in the Network panel and chooses this option, DevTools serialises the requests into a curl command line tailored for the Windows cmd.exe shell, so the developer can paste it into a command prompt and replay the traffic.

The report concerns the Windows variant of that serialiser. The claim is that the code that escapes untrusted request data before embedding it in the generated command line is incomplete, and that a crafted request can therefore break out of the intended curl argument and run arbitrary commands when the copied text is pasted into cmd.exe.

The issue is tracked as CVE-2025-12907, with the weakness described as insufficient validation of untrusted input in DevTools. It was reported through the Chrome VRP by Ameen Basha M K, rated low severity, and a bounty of 1500.00 USD was awarded. It was disclosed on 2025-09-02.

Setup

The preconditions are modest:

  1. A Windows machine with Chrome installed. The report lists the Chrome channel as Canary.
  2. A proof-of-concept HTML page, opened in Chrome, that causes the browser to issue a request containing the malicious characters.
  3. Access to the DevTools Network panel, and the "Copy all as cURL (cmd)" context menu entry.
  4. A cmd.exe prompt into which the copied text is pasted.

No account, role or special configuration is described. The attack surface is the developer's own workflow: inspecting traffic and replaying it from the command line.

Finding it

The researcher observed that the escaping applied to request data in the "Copy as cURL (cmd)" output handles carriage returns (\r) but does not sanitise the tab character (\t).

That matters because cmd.exe treats a tab as a delimiter in the same way it treats a space. If a tab survives into the generated command line, it can terminate the current argument. A following command separator such as &, combined with a newline sequence, then allows the injected text to be interpreted as a separate command rather than as part of the curl invocation.

The researcher also notes that this is a bypass of a previous security fix, which only addressed newline characters. In other words, the earlier hardening closed one path into the same injection primitive but left the tab character unhandled.

Exploitation

Step 1: Open the proof-of-concept page

Text
Open the poc html in chrome

The page is opened in Chrome. The report refers to an attached HTML file but does not reproduce its contents, so the exact request that carries the payload is not shown. What the page does, per the description, is cause a request whose data contains a tab followed by a command separator and a newline sequence.

Step 2: Copy the requests as cURL for cmd

Text
open network teab and copy the requests with - copy all as curl (cmd) feature

With the Network panel open, the researcher uses the "Copy all as cURL (cmd)" feature. DevTools generates a cmd.exe-oriented curl command line for the captured requests. Because the tab is not escaped, the generated text contains the injected delimiter and separator intact.

Step 3: Paste into the command prompt

Text
paste the command on cmd you can see the calc popup

When the copied text is pasted into cmd.exe, the shell parses the tab as an argument delimiter, the & as a command separator, and the newline sequence as the end of the injected command. The result is execution of the attacker's command with the user's privileges. In the proof of concept the command opens the Windows calculator, which is the visible confirmation that arbitrary command execution occurred.

The report states that a proof-of-concept video and HTML file were attached for reference.

Root cause

The serialiser that builds the cmd.exe command line escapes carriage returns but not tabs. Since cmd.exe treats a tab as whitespace-equivalent for argument separation, an unescaped tab inside request-derived data lets the attacker end the intended curl argument early. A command separator such as & followed by a newline sequence then starts a new command in the pasted text.

The existing defence was a prior fix that handled newline characters only. That fix addressed one class of shell metacharacter but not the full set that cmd.exe honours, so the tab-based path remained open. The report describes this explicitly as a bypass of that earlier fix.

Impact

The vulnerability allows arbitrary code execution on a user's machine. The condition is that the user is tricked into pasting a crafted cURL command from a malicious source: the payload has to reach the Network panel as request data, be copied through the affected feature, and then be pasted into a Windows command prompt. Under those conditions the attacker's commands run with the user's privileges.

The report does not describe any path that triggers execution without the paste step, and it does not quantify how likely a user is to copy and paste traffic from a malicious page. The platform rated the issue low severity.

Fix

The report does not state what change was made. The implied requirement is that the "Copy as cURL (cmd)" serialiser must escape the tab character in the same way it already escapes carriage returns, so that request-derived data cannot terminate an argument or introduce a command separator in the generated cmd.exe command line. More generally, the escaping should cover the full set of characters that cmd.exe treats as delimiters or separators, rather than being extended one character at a time.

Variants to test

  1. Other whitespace-equivalent characters in cmd.exe output. Try request data containing tabs in different positions: inside a header value, inside a URL query string, inside a POST body. A positive result is a generated command line in which the tab survives unescaped.
  2. Other shell targets of the same feature. A positive result is a character that is special to the target shell but left unescaped in the copied text.
  3. Other copy features. Look at neighbouring DevTools copy actions that serialise request data into a command or script, and test whether they apply the same escaping. A positive result is any generated text where attacker-controlled request data can break out of its quoting.
  4. Characters adjacent to the previously fixed one. Since the earlier fix covered newlines, test carriage return and newline combinations, and other control characters, to see whether the escaping is a blocklist that can be sidestepped. A positive result is any control character that reaches the output unchanged.

Hunting notes

This class of bug hides in developer tooling that turns untrusted data into shell syntax: copy-as-cURL, copy-as-fetch, HAR export, and any feature that produces a command for a specific shell. The signal during review is a serialiser that escapes some metacharacters but not all, especially when the escaping is written as a list of individual characters rather than derived from the shell's grammar.

A prior fix in the same area is a strong hint: if newline handling was patched once, the neighbouring characters are worth testing. The researcher demonstrated impact by showing the full chain end to end, from a page opened in the browser, through the Network panel and the copy feature, to a command executing in cmd.exe, with the calculator popup as visible proof.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

Chrome has a set of built-in tools for web developers, called DevTools. One of them, the Network panel, shows every request the browser makes to a website. A developer can right-click a request and choose "Copy as cURL (cmd)", which turns that request into a text command they can paste into a Windows command prompt to send the same request again.

The problem is that the text Chrome generates is not cleaned properly. If a website can put certain special characters into a request, those characters end up in the copied text unchanged. When the developer pastes that text into the Windows command prompt, the prompt reads part of it as a brand new command and runs it. In the proof of concept, that new command opens the Windows calculator, which is a harmless way of showing that any command could have been run.

The issue is tracked as CVE-2025-12907, described as insufficient validation of untrusted input in DevTools. It was reported through the Chrome VRP by Ameen Basha M K, rated low severity, and a bounty of 1500.00 USD was awarded. It was disclosed on 2025-09-02.

The pieces you need to know

Before the steps make sense, here are the parts of the picture, explained from scratch.

Chrome DevTools. A panel built into Chrome, opened with F12 or by right-clicking a page and choosing Inspect. It is meant for people building websites, but anyone can open it.

The Network panel. One tab inside DevTools. It lists every request the browser sends and every response it gets back. Think of it as a logbook of the conversation between the browser and the website.

A request. When you load a page, your browser asks the website's server for files and data. Each ask is a request. A request can carry extra data, for example in its address (the URL), in its headers (small labels attached to the request), or in a body (data sent along with it).

cURL. A command-line program for sending requests. Developers use it to repeat a request outside the browser, for example to test something quickly or to share a request with a colleague. A cURL command is just a line of text starting with the word curl followed by options and the address.

cmd.exe. The classic Windows command prompt. It is a program that reads lines of text you type or paste and runs the commands in them. It has its own rules about which characters separate one command from another.

Copy as cURL (cmd). The DevTools feature at the centre of this report. It takes the requests shown in the Network panel and writes them out as cURL command lines formatted for cmd.exe, so the developer can paste them into a command prompt and replay the traffic.

Command injection. A class of vulnerability where an attacker manages to slip extra commands into text that some program is going to run. The everyday comparison: imagine a form where you write "deliver 2 pizzas to Bob" and someone writes "deliver 2 pizzas to Bob and also unlock the back door". If the shop's system reads the whole line literally, it does both things. Command injection is the software version of that.

Escaping and sanitising. When a program builds a command out of data it did not write itself, it must neutralise characters that the command interpreter treats as special. This is called escaping or sanitising. The everyday comparison: if you are writing a shopping list and an item is literally called "milk, eggs and bread", you need a way to show that the commas are part of the name and not separators between three items. Escaping is that way.

Carriage return (\r) and tab (\t). Two invisible characters. A carriage return moves the cursor back to the start of the line. A tab moves it to the next tab stop. Neither is visible on screen, which is exactly why they are easy to overlook.

Delimiter and separator. A delimiter is a character that marks where one piece of text ends and the next begins, like the space between words. A separator is a character that marks where one command ends and the next begins. In cmd.exe, a tab works as a delimiter just like a space, and & works as a separator.

The setup

The preconditions are modest:

  1. A Windows machine with Chrome installed. The report lists the Chrome channel as Canary, the experimental build of Chrome that gets changes first.
  2. A proof-of-concept HTML page, opened in Chrome, that causes the browser to issue a request containing the malicious characters.
  3. Access to the DevTools Network panel, and the "Copy all as cURL (cmd)" context menu entry.
  4. A cmd.exe prompt into which the copied text is pasted.

No account, role or special configuration is described. The attack surface is the developer's own workflow: inspecting traffic and replaying it from the command line.

Finding it

The researcher observed that the escaping applied to request data in the "Copy as cURL (cmd)" output handles carriage returns (\r) but does not sanitise the tab character (\t).

That matters because cmd.exe treats a tab as a delimiter in the same way it treats a space. If a tab survives into the generated command line, it can terminate the current argument. A following command separator such as &, combined with a newline sequence, then allows the injected text to be interpreted as a separate command rather than as part of the curl invocation.

The researcher also notes that this is a bypass of a previous security fix, which only addressed newline characters. In other words, the earlier hardening closed one path into the same injection primitive but left the tab character unhandled.

Exploitation

Step 1: Open the proof-of-concept page

Text
Open the poc html in chrome

This line is the first reproduction step: open the prepared HTML file in Chrome. The page is opened in Chrome. The report refers to an attached HTML file but does not reproduce its contents, so the exact request that carries the payload is not shown. What the page does, per the description, is cause a request whose data contains a tab followed by a command separator and a newline sequence.

Step 2: Copy the requests as cURL for cmd

Text
open network teab and copy the requests with - copy all as curl (cmd) feature

This line is the second reproduction step, written as the researcher typed it ("teab" is the Network tab). With the Network panel open, the researcher uses the "Copy all as cURL (cmd)" feature. The reason for this step is to make Chrome turn the captured requests into a command line, which is the moment where the escaping should happen. DevTools generates a cmd.exe-oriented curl command line for the captured requests. Because the tab is not escaped, the generated text contains the injected delimiter and separator intact.

Step 3: Paste into the command prompt

Text
paste the command on cmd you can see the calc popup

This line is the third reproduction step: paste the copied text into a Windows command prompt. The reason for this step is that the text only becomes dangerous when a shell reads it. When the copied text is pasted into cmd.exe, the shell parses the tab as an argument delimiter, the & as a command separator, and the newline sequence as the end of the injected command. The result is execution of the attacker's command with the user's privileges. In the proof of concept the command opens the Windows calculator, which is the visible confirmation that arbitrary command execution occurred.

The report states that a proof-of-concept video and HTML file were attached for reference.

Root cause

The serialiser, the part of DevTools that builds the cmd.exe command line, escapes carriage returns but not tabs. Since cmd.exe treats a tab as whitespace-equivalent for argument separation, an unescaped tab inside request-derived data lets the attacker end the intended curl argument early. A command separator such as & followed by a newline sequence then starts a new command in the pasted text.

The existing defence was a prior fix that handled newline characters only. That fix addressed one class of shell metacharacter but not the full set that cmd.exe honours, so the tab-based path remained open. The report describes this explicitly as a bypass of that earlier fix.

Impact

The vulnerability allows arbitrary code execution on a user's machine. The condition is that the user is tricked into pasting a crafted cURL command from a malicious source: the payload has to reach the Network panel as request data, be copied through the affected feature, and then be pasted into a Windows command prompt. Under those conditions the attacker's commands run with the user's privileges.

The report does not describe any path that triggers execution without the paste step, and it does not quantify how likely a user is to copy and paste traffic from a malicious page. The platform rated the issue low severity.

Fix

The report does not state what change was made. The implied requirement is that the "Copy as cURL (cmd)" serialiser must escape the tab character in the same way it already escapes carriage returns, so that request-derived data cannot terminate an argument or introduce a command separator in the generated cmd.exe command line. More generally, the escaping should cover the full set of characters that cmd.exe treats as delimiters or separators, rather than being extended one character at a time.

Variants to test

  1. Other whitespace-equivalent characters in cmd.exe output. Try request data containing tabs in different positions: inside a header value, inside a URL query string, inside a POST body. A positive result is a generated command line in which the tab survives unescaped.
  2. Other shell targets of the same feature. A positive result is a character that is special to the target shell but left unescaped in the copied text.
  3. Other copy features. Look at neighbouring DevTools copy actions that serialise request data into a command or script, and test whether they apply the same escaping. A positive result is any generated text where attacker-controlled request data can break out of its quoting.
  4. Characters adjacent to the previously fixed one. Since the earlier fix covered newlines, test carriage return and newline combinations, and other control characters, to see whether the escaping is a blocklist that can be sidestepped. A positive result is any control character that reaches the output unchanged.

Hunting notes

This class of bug hides in developer tooling that turns untrusted data into shell syntax: copy-as-cURL, copy-as-fetch, HAR export, and any feature that produces a command for a specific shell. The signal during review is a serialiser that escapes some metacharacters but not all, especially when the escaping is written as a list of individual characters rather than derived from the shell's grammar.

A prior fix in the same area is a strong hint: if newline handling was patched once, the neighbouring characters are worth testing. The researcher demonstrated impact by showing the full chain end to end, from a page opened in the browser, through the Network panel and the copy feature, to a command executing in cmd.exe, with the calculator popup as visible proof.

Glossary

  • Arbitrary code execution: the ability for an attacker to make a computer run commands of their choosing, rather than only the ones the software intended.
  • Bounty: a payment a company gives a researcher who reports a valid security problem.
  • Bypass: getting around a protection that was put in place earlier, so the same kind of attack works again through a different route.
  • Canary: an experimental build of Chrome that receives new changes before the stable release.
  • Carriage return (\r): an invisible control character that moves the cursor to the start of the line.
  • Chrome VRP: Chrome's Vulnerability Reward Program, the scheme through which security reports about Chrome are submitted and rewarded.
  • cmd.exe: the classic Windows command prompt, a program that reads lines of text and runs the commands in them.
  • Command separator: a character such as & that tells a shell one command has ended and another begins.
  • cURL: a command-line program for sending requests to servers, often used to replay a request captured in a browser.
  • CVE: a public identifier given to a known security vulnerability so people can refer to it unambiguously.
  • Delimiter: a character that marks where one piece of text ends and the next begins, such as a space between words.
  • DevTools: the set of developer tools built into Chrome, opened with F12 or the Inspect option.
  • Escaping: rewriting special characters in data so that a command interpreter treats them as plain text rather than as instructions.
  • HAR export: a feature that saves the requests and responses from the Network panel into a file, which other tools can then read.
  • Header: a small label attached to a request or response, carrying information such as the content type.
  • HTML: the language web pages are written in; an HTML file is a page you can open in a browser.
  • Metacharacter: a character that has a special meaning to a shell or other interpreter rather than standing for itself.
  • Network panel: the DevTools tab that lists every request the browser sends and every response it receives.
  • Newline: an invisible character that marks the end of a line of text.
  • Proof of concept (PoC): a small, deliberately harmless demonstration that a vulnerability is real, such as opening the calculator.
  • Request: a message the browser sends to a server asking for a page, a file or data.
  • Sanitising: cleaning data before using it, by removing or neutralising anything that could be interpreted as an instruction.
  • Serialiser: the part of a program that turns data into a text format, here turning captured requests into a command line.
  • Severity: a rating of how serious a vulnerability is, often from low to critical.
  • Shell: a program that reads commands as text and runs them; cmd.exe is the Windows shell.
  • Tab (\t): an invisible control character that moves the cursor to the next tab stop, and which cmd.exe treats like a space.
  • URL: the address of something on the web, such as the address in your browser's bar.
  • Vulnerability: a weakness in software that an attacker can use to make it behave in a way its makers did not intend.

More by Ameen Basha M K

View all

23 more disclosed reports, best first.

More from Google Chrome

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.