Integer overflow in Skia (CVE-2026-9909)
An integer overflow in Skia's SubRunAllocator during SKP deserialization can produce a negative allocation size, bypassing capacity checks and returning an undersized buffer. This allows a massive linear heap out-of-bounds write, potentially leading to remote code execution in the Paint Preview utility process via a race condition.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 55 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 without the security team.
Overview: An integer overflow in Skia's SubRunAllocator during SKP deserialization can result in a negative allocation size, bypassing capacity checks. This returns an undersized arena pointer, allowing an attacker to perform a massive linear heap out-of-bounds write. While PartitionAlloc guard pages ensure an eventual crash, a concurrent thread could access corrupted data in the 2 MB window before the crash, potentially leading to RCE in the Paint Preview utility process.
Affected files:
third_party/skia/src/text/gpu/SubRunAllocator.hthird_party/skia/src/text/gpu/GlyphVector.cppthird_party/skia/src/text/gpu/SubRunContainer.cppcomponents/paint_preview/common/serial_utils.cc
Estimated timestamp from git blame: 2026-02-24
Summary
There is a potential integer overflow vulnerability in Skia's SubRunAllocator within BagOfBytes::allocateBytesFor. When deserializing SkPicture (SKP) payloads in the PaintPreviewCompositor utility process, an attacker can supply a large glyphCount that causes an allocation size calculation to overflow a 32-bit signed integer to a negative value. This bypasses internal capacity checks and returns an undersized memory chunk. The subsequent initialization loop performs a massive out-of-bounds (OOB) heap write.
While PartitionAlloc's 2 MB Super Page guard pages make a crash deterministic, an attacker can overwrite up to 2 MB of adjacent heap objects prior to the crash, which may be exploitable via a race condition.
Root Cause Analysis
The vulnerability lies in third_party/skia/src/text/gpu/SubRunAllocator.h:
template <size_t Size, size_t Alignment>
char* allocateBytesFor(int n = 1)
requires (Alignment <= kMaxAlignment && Size < kMaxByteSize && Size % Alignment == 0) {
int size = n ? n * Size : 1;
SkASSERT_RELEASE(size <= kMaxByteSize);
return this->allocateBytes(size, Alignment);
}
When n is large (e.g., 0x10000000 or 268,435,456) and Size is 8 (the size of GlyphBytes on 64-bit systems), the multiplication n * Size is performed as a 64-bit size_t due to C++ promotion rules, resulting in 0x0000000080000000.
This value is then assigned to the 32-bit signed integer size, where it overflows and is interpreted as INT_MIN (-2,147,483,648).
- The check
SkASSERT_RELEASE(size <= kMaxByteSize)passes because a negative number is mathematically less than the positive limit. - The method calls
allocateBytes(-2147483648, 8). - Inside
allocateBytes, the conditionif (fCapacity < size)(e.g.,4096 < -2147483648) evaluates to false, bypassing the need to allocate more memory. - The method updates the capacity (
fCapacity -= size), causing a massive positive overflow, and returns a pointer to the current, undersized arena block.
Potential Attack Path
These are suggested steps based on static analysis, as our tooling cannot currently run code to provide a working Proof of Concept:
-
Compromise Renderer: An attacker compromises a renderer process.
-
Craft Payload: The attacker crafts a malicious SKP containing a
DrawSlugOpwith aglyphCountof0x10000000. The SKP is padded to exactly 1 GB to satisfy availability checks. -
Deliver Payload: The SKP is sent via Mojo using
mojo_base.mojom.BigBufferto thePaintPreviewCompositorutility process. (Note: This is unreachable via OOP-R because OOP-R restricts serializedPaintOps to 16 MB, but Paint Preview allows gigabyte-scale payloads). -
Trigger Overflow:
GlyphVector::MakeFromBuffer(third_party/skia/src/text/gpu/GlyphVector.cpp:61) reads theglyphCount. The value passes theglyphCount <= INT_MAX / sizeof(uint32_t)check and thebuffer.available()check. It then requests an allocation for the glyphs, triggering the integer overflow inSubRunAllocatoras described above. -
Heap Corruption:
GlyphVectorenters its deserialization loop:C++ for (int i = 0; i < glyphCount; i++) { *reinterpret_cast<SkPackedGlyphID*>(glyphs[i].data()) = SkPackedGlyphID(buffer.readUInt()); }This loop writes 4 bytes and skips 4 bytes over the course of
0x10000000iterations, writing attacker-controlled 20-bit values linearly across the heap. -
Exploitation: The linear write traverses PartitionAlloc. While it will inevitably hit a
PROT_NONEguard page at a 2 MB Super Page boundary and crash, it will overwrite up to 2 MB of adjacent heap objects in the current Super Page before doing so. If the attacker grooms the heap and triggers a concurrent thread to interact with the corrupted objects (e.g., vtable pointers) before the crash, they may achieve Remote Code Execution (RCE) in the sandboxed utility process.
Suggested Fix
Refactor allocateBytesFor in SubRunAllocator.h to use Skia's safe math utilities (or base::CheckedNumeric if permitted in this context) to prevent integer overflows during size calculations. Alternatively, explicitly cast the size to size_t and validate it against kMaxByteSize before converting it to an int for the arena logic:
size_t safe_size = (size_t)n * Size;
SkASSERT_RELEASE(safe_size <= kMaxByteSize);
int size = static_cast<int>(safe_size);
Furthermore, adding strict bounds checking on fCapacity and size in BagOfBytes::allocateBytes to reject negative sizes would serve as an effective defense-in-depth measure.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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
Likely the multiplication of a large glyph count by the element size overflows a 32-bit signed integer, producing a negative size that passes a naive upper-bound check and is used as a valid allocation size.
Impact
An attacker could overwrite up to 2 MB of adjacent heap objects before a crash, and with heap grooming and a concurrent thread, may achieve remote code execution in the sandboxed utility process.
What the attacker needed
Compromised renderer process; ability to send a 1 GB SKP payload
The fix
The code should be fixed by using safe math utilities or explicit size_t casting and validation to prevent integer overflows during size calculations, and by adding strict bounds checking to reject negative sizes.
How it was found
- Compromise a renderer process.
- Craft a malicious SKP containing a DrawSlugOp with a large glyphCount, padded to 1 GB.
- Send the SKP via Mojo BigBuffer to the PaintPreviewCompositor utility process.
- Trigger the integer overflow in SubRunAllocator when GlyphVector reads the glyphCount.
- Enter the deserialization loop that writes attacker-controlled values linearly across the heap.
- Exploit the heap corruption before the inevitable crash at a guard page, possibly via a race condition.
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.
When a program reads a file, it often calculates how much memory to reserve based on numbers in that file. Here, a very large number caused the calculation to wrap around to a negative value, so the program reserved far too little memory but then wrote a huge amount of data, overflowing into neighbouring memory. This could let an attacker corrupt other data and possibly run their own code.
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.