Integer overflow in Skia (CVE-2024-9123)
An integer overflow in Skia's DrawAtlasOpImpl constructor leads to a null pointer offset and undefined behaviour when processing a crafted SKP file. An attacker could potentially cause a crash or out-of-bounds write by supplying a malicious SKP file.
- Fix shipped in 21 days
Steps to reproduce the problem
- build skia skpbench
- out/asan/skpbench --src output.skp --config gl
- you will see
raven@192 ~/w/s/skia (main)> out/asan/skpbench --src output.skp --config gl
accum median max min stddev samples sample_ms clock metric config bench
alloc_size------>>-2147483616
../../src/gpu/ganesh/ops/DrawAtlasOp.cpp:191:53: runtime error: applying non-zero offset 8 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../src/gpu/ganesh/ops/DrawAtlasOp.cpp:191:53 in
fish: Job 1, 'out/asan/skpbench --src output.…' terminated by signal SIGABRT (Abort)
``
# Problem Description
above all
# Summary
out of bound write in skia DrawAtlasOpImpl::DrawAtlasOpImpl
# Additional Data
Category: Security \
Chrome Channel: Not sure \
Regression: N/A
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 an integer overflow in the DrawAtlasOpImpl constructor when calculating allocation size, leading to a null pointer offset and out-of-bounds write.
What the attacker needed
Crafted SKP file; victim opens the file
How it was found
- Build the skpbench tool from Skia.
- Run skpbench with the crafted SKP file and GL configuration.
- Observe the sanitizer error and crash.
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.
Skia is a graphics library used by Chrome and Android to draw things on screen. A specially crafted file can cause a number to overflow, making the program write data to the wrong place in memory, which can crash it or allow an attacker to 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.