Skip to content
RCE Advisory Advanced CVE-2026-87572

Injection in DevTools (CVE-2026-87572)

A validation gap in DevToolsSession::ValidateMessage lets a compromised renderer embed NUL-delimited JSON inside a CBOR string, which is written verbatim to an ASCIIZ pipe and parsed by the external client as a root-level CDP command. This could allow a sandboxed renderer to inject arbitrary browser-level DevTools commands.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 43 days

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential validation bypass in DevToolsSession::ValidateMessage allows a compromised renderer to inject arbitrary Chrome DevTools Protocol (CDP) commands into the root browser session. By placing a NUL-delimited JSON string inside a CBOR STRING8 value, the outer CBOR envelope size check is satisfied. When written verbatim to an external ASCIIZ pipe, the client splits the stream on the embedded NULs and parses the injected frame as a standalone root-level command.

Affected files:

  • content/browser/devtools/devtools_session.cc
  • third_party/inspector_protocol/crdtp/cbor.cc
  • content/browser/devtools/devtools_pipe_handler.cc
  • content/browser/devtools/protocol/target_handler.cc

Estimated timestamp from git blame: 2026-06-26

Root Cause Analysis

In content/browser/devtools/devtools_session.cc, the security check DevToolsSession::ValidateMessage ensures that a child session message from a renderer does not contain trailing bytes (which previously allowed pipe-frame injection) and verifies top-level parameters such as sessionId and the absence of an id field for notifications:

C++
// content/browser/devtools/devtools_session.cc:783-794
} else {
  // Perform top-level validation of CBOR envelope.
  crdtp::StatusOr<size_t> status_or_outer_size =
      crdtp::cbor::CheckCBORMessage(span_message);
  if (!status_or_outer_size.ok()) { ... return false; }
  if (status_or_outer_size.value() != message.size()) {
    DLOG(ERROR) << "Unexpected trailing data in CBOR message from child";
    return false;
  }
}

While this check correctly rejects trailing data after the first CBOR envelope, it does not validate the contents of fields inside the envelope. When a compromised renderer sends CBOR, crdtp::cbor::CheckCBORMessage only verifies the envelope header and the indefinite-length map start. Top-level keys and values are then parsed with the CBORTokenizer (third_party/inspector_protocol/crdtp/cbor.cc).

When encountering a MajorType::STRING (STRING8) token, the tokenizer reads the length and skips the bytes as an opaque payload without content validation or checking for embedded NUL (0x00) characters:

C++
// third_party/inspector_protocol/crdtp/cbor.cc:759-771
case MajorType::STRING: {  // STRING8.
  if (!bytes_read || token_start_internal_value_ > kMaxValidLength) {
    SetError(Error::CBOR_INVALID_STRING8); return;
  }
  uint64_t token_byte_length = token_start_internal_value_ + bytes_read;
  if (token_byte_length > remaining_bytes) {
    SetError(Error::CBOR_INVALID_STRING8); return;
  }
  SetToken(CBORTokenTag::STRING8, static_cast<size_t>(token_byte_length));
  return;
}

Because the raw unchanged buffer is forwarded to the client (client->DispatchProtocolMessage(agent_host, message->data)) on the renderer-originating path without format conversion, the malicious CBOR is ultimately written verbatim onto the ASCIIZ debugging pipe:

C++
// content/browser/devtools/devtools_pipe_handler.cc:294-297
void PipeWriterASCIIZ::WriteIntoPipe(std::string message) override {
  WriteBytes(message.data(), message.size());
  WriteBytes("\0", 1);
}

Potential Attack Scenario

  1. A compromised renderer for a child session S constructs a custom CBOR map satisfying outer_size == message.size().
  2. The map contains "sessionId": S, a dummy parameter key "z", and a corresponding value encoded as a CBOR STRING8 containing: <padding> \0 <INJECTED_JSON> \0 <padding>, where <INJECTED_JSON> is a root-session CDP command (e.g. {"method":"Browser.getVersion","id":1000}).
  3. The renderer transmits this via the Mojo interface blink.mojom.DevToolsSessionHost.DispatchProtocolNotification.
  4. DevToolsSession::ValidateMessage passes because the outer envelope size matches and no top-level id exists. The nested STRING8 payload is skipped as a single token without inspection.
  5. The raw CBOR buffer is written verbatim to the external ASCIIZ pipe via PipeWriterASCIIZ.
  6. The external client (e.g., Puppeteer or Playwright running with pipe:true) reads the stream and splits it on NUL (0x00) bytes.
  7. The first segment (CBOR header) and third segment (CBOR trailer) fail JSON parsing and are discarded, but the middle segment (<INJECTED_JSON>) is parsed successfully as a root browser-level command, bypassing sandbox boundaries.

Note: These steps are based on static code analysis; our automated tools do not currently have the capability to execute code or run dynamic proofs of concept.

Suggested Fix

On the renderer-to-client message routing path, Chromium should enforce that messages are serialized to the expected protocol format of the destination client. Specifically, in DevToolsSession::DispatchProtocolResponseOrNotification, if the client is not using a binary protocol (!client->UsesBinaryProtocol()), the CBOR message should be translated to JSON before being sent to the client, which will automatically escape any control characters and NUL bytes inside string values.

Evaluated with Chrome root at commit: 94d9235ebe3b7276e5284f0dc5d55577ff949908


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

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

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

Root cause

Likely the CBOR tokenizer treats STRING8 values as opaque bytes without rejecting embedded NUL characters, and the renderer-originating path forwards the raw CBOR buffer to an ASCIIZ pipe without converting it to JSON.

Impact

A compromised renderer could inject arbitrary root-level CDP commands, bypassing sandbox boundaries, though the report notes this is based on static analysis without a dynamic proof of concept.

What the attacker needed

Compromised renderer; external client using pipe:true

The fix

The report suggests that when the client does not use a binary protocol, the CBOR message should be translated to JSON before being sent, which would escape control characters and NUL bytes inside string values.

How it was found

  1. A compromised renderer for a child session builds a CBOR map whose outer size matches the message size.
  2. The map includes the sessionId, a dummy key, and a STRING8 value containing padding, a NUL, an injected root-session JSON command, another NUL, and padding.
  3. The renderer sends this through the DevToolsSessionHost Mojo interface.
  4. ValidateMessage passes because the outer envelope size matches and there is no top-level id.
  5. The raw CBOR buffer is written verbatim to the external ASCIIZ pipe.
  6. The external client splits on NUL bytes, discards the unparseable first and third segments, and parses the middle segment as a root browser-level 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.

Chrome's DevTools can talk to a debugging client over a pipe, and messages are checked before being passed on. The check only looked at the outer wrapper of a message, not inside text fields, so a malicious page could hide an extra command inside a string. The client then split the stream on null bytes and ran the hidden command as if it came from the browser itself.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

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.