Heap buffer overflow in CrashReporting (CVE-2026-19138)
A heap out-of-bounds write and integer underflow in Crashpad's stack sanitisation logic can be triggered by a compromised renderer sending a crafted crash dump request. This corrupts memory in the unsandboxed crash handler and could theoretically lead to a sandbox escape via a race condition.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 months
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 without the security team.
Overview: A compromised renderer can trigger a heap out-of-bounds write and massive memory corruption in the unsandboxed chrome_crashpad_handler by requesting a stack-sanitized crash dump. By manipulating a thread's Stack Pointer and TLS registers, the attacker forces an integer underflow during buffer sanitization. While this heavily corrupts memory and guarantees an eventual crash, exploiting a race condition could theoretically lead to a sandbox escape.
Affected files:
third_party/crashpad/crashpad/snapshot/sanitized/memory_snapshot_sanitized.ccthird_party/crashpad/crashpad/snapshot/memory_snapshot_generic.h
Estimated timestamp from git blame: 2023-04-10
Summary
A potential heap out-of-bounds (OOB) write and integer underflow exists in the stack sanitization logic of Crashpad. The vulnerability occurs when the MemorySanitizer processes a highly specific, attacker-controlled stack memory region that is very small (e.g., 1 byte) and unaligned. This can be triggered by a compromised renderer process, potentially leading to a sandbox escape via memory corruption in the privileged chrome_crashpad_handler process.
Root Cause Analysis
The vulnerability is located in third_party/crashpad/crashpad/snapshot/sanitized/memory_snapshot_sanitized.cc within the MemorySanitizer::Sanitize template function:
// Sanitize up to a word-aligned address.
const size_t aligned_offset =
((address_ + sizeof(Pointer) - 1) & ~(sizeof(Pointer) - 1)) - address_;
memcpy(data, &defaced, aligned_offset);
// Sanitize words that aren't small and don't look like pointers.
size_t word_count = (size - aligned_offset) / sizeof(Pointer);
The aligned_offset is calculated as the distance from the region's base address_ to the next word-aligned boundary. For a 64-bit architecture, this can be up to 7 bytes.
The function crucially assumes that size >= aligned_offset. If an attacker can force a situation where size < aligned_offset, two critical memory corruptions occur:
- Heap OOB Write: The
memcpywritesaligned_offsetbytes (e.g., 7) of thedefacedconstant intodata. If the underlying heap buffer is onlysizebytes (e.g., 1 byte), this overflows the buffer. - Integer Underflow: The calculation
(size - aligned_offset)uses unsigned arithmetic (size_t). Whensize < aligned_offset, this underflows to a massive value (e.g.,~0x1FFFFFFFFFFFFFFE). The subsequent loop iterates over this massiveword_count, blindly overwriting vast swathes of the handler's heap memory with0x0defaced0defaceduntil the process hits an unmapped page and crashes.
Potential Attack Steps
Note: These are suggested steps; we do not currently have a working proof of concept to run this exploit end-to-end.
- A compromised renderer process creates a new thread.
- The attacker manipulates the thread's registers to craft an invalid stack layout:
- Sets the Stack Pointer (SP) to an unaligned memory address
X, whereX % 8 == 1. - Sets the Thread Local Storage (TLS) register to
X + 1.
- Sets the Stack Pointer (SP) to an unaligned memory address
- The attacker creates a
SanitizationInformationstruct in its memory and setssanitize_stacks = true. - The attacker sends a
kTypeCrashDumpRequestIPC to the unsandboxedchrome_crashpad_handler, pointing to this struct. - The handler's
ProcessReaderLinux::Thread::InitializeStackFromSPlogic calculates the thread's stack size astls_address - stack_region_address. Due to the attacker's setup (X + 1minusX), the stack size is evaluated as1byte. - The handler allocates a 1-byte heap buffer for the stack snapshot and passes it to
MemorySanitizer::Sanitize. Sanitizeevaluatesaligned_offsetas7, triggering the out-of-boundsmemcpyand the integer underflow.- The massive memory corruption loop races against other handler threads (like the upload thread). If the attacker can win a race condition using the corrupted heap state before the inevitable segmentation fault, this could result in arbitrary code execution (sandbox escape).
Suggested Fix
Add bounds checking in MemorySanitizer::Sanitize to ensure that aligned_offset does not exceed the buffer size.
// Sanitize up to a word-aligned address, bounded by the region size.
const size_t aligned_offset = std::min(
size,
((address_ + sizeof(Pointer) - 1) & ~(sizeof(Pointer) - 1)) - address_);
memcpy(data, &defaced, aligned_offset);
// Sanitize words that aren't small and don't look like pointers.
size_t word_count = (size - aligned_offset) / sizeof(Pointer);
Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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.
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
The code assumes the buffer size is at least as large as the alignment offset, but an attacker can make the size smaller, causing an out-of-bounds write and an unsigned integer underflow.
Impact
This heavily corrupts memory and guarantees an eventual crash, but exploiting a race condition could theoretically lead to a sandbox escape.
What the attacker needed
Compromised renderer process; ability to send IPC to crash handler
The fix
Add bounds checking in MemorySanitizer::Sanitize to ensure that aligned_offset does not exceed the buffer size.
How it was found
- A compromised renderer process creates a new thread.
- The attacker manipulates the thread's registers to craft an invalid stack layout.
- The attacker creates a SanitizationInformation struct in its memory and sets sanitize_stacks = true.
- The attacker sends a kTypeCrashDumpRequest IPC to the unsandboxed chrome_crashpad_handler, pointing to this struct.
- The handler calculates the thread's stack size as 1 byte.
- The handler allocates a 1-byte heap buffer and passes it to MemorySanitizer::Sanitize, triggering the overflow.
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.
A compromised renderer process can send a special request to the crash handler, which runs with higher privileges. The crash handler then miscalculates a buffer size, writing past the end of a small memory buffer and corrupting lots of memory. This could let an attacker escape the browser's sandbox, though it is very hard to exploit.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.