Out of bounds write in Skia (CVE-2026-19173)
The structured Mojo interface for HDR metadata accepts an unbounded number of AGTM alternate images, but Skia only allocates fixed-size arrays for four alternates plus the baseline. A renderer-supplied object with 64 entries causes an out-of-bounds write in the GPU process during OOP raster, which crashed the GPU process in the author's build.
Originally disclosed on Chrome VRP
- Fix shipped in 14 days
Brief description
The structured Mojo path accepts an arbitrary number of AGTM
alternate_images, while Skia allocates arrays for at most four alternate
images plus the baseline. A renderer-authored AGTM object with 64 entries
reaches skhdr::AgtmHelpers::ComputeWeighting() during GPU OOP raster and
writes beyond both fixed-size arrays.
This is a compromised-renderer simulation. The HTML page contains only a normal P3/PQ AVIF image; the attached renderer-only patch supplies the malformed structured metadata at the paint serialization boundary. I do not claim that unmodified web content can create this object, and I do not claim RCE, instruction-pointer control, or sandbox escape.
Reproduced result
On the attached full Chrome ASan build, the GPU process reached:
skhdr::AgtmHelpers::ComputeWeighting
third_party/skia/src/codec/SkHdrAgtm.cpp:471:1
skhdr::AgtmHelpers::MakeColorFilter
third_party/skia/src/codec/SkHdrAgtm.cpp:533:28
skhdr::Metadata::makeToneMapColorFilter
third_party/skia/src/codec/SkHdrMetadata.cpp:255:12
cc::ToneMapUtil::AddGlobalToneMapFilterToPaint
cc/paint/tone_map_util.cc:98:40
gpu::raster::RasterDecoderImpl::DoRasterCHROMIUM
gpu/command_buffer/service/raster_decoder.cc:3067:22
The GPU process reported Received signal 4 ILL_ILLOPN and exited with
exit_code=4. The complete raw and symbolized output is attached as
asan.log. This ASan build emitted Chromium's signal stack rather than a
conventional ERROR: AddressSanitizer red-zone report; that is stated
explicitly in the attachment.
Version and environment
- Chrome build identifier:
152.0.7951.0 - Chromium revision:
6e23d2ad7440702de4442bc8e8627e95b2aa3285 - Skia revision:
ca065587acac8432379ae196812dd3ec663129c2 - OS: Ubuntu 24.04, Linux x86_64, kernel
7.0.0-28-generic - Build: ASan component build,
is_debug=false,is_asan=true,is_component_build=true,dcheck_always_on=true,symbol_level=1
Reproduction
- Check out Chromium revision
6e23d2ad7440702de4442bc8e8627e95b2aa3285. - Apply
renderer_simulation.patchand buildout/asan/chrome. - Place
poc.htmlbesidecosmos1650_yuv444_10bpc_p3pq.avif. - Run the full Chrome binary with a clean temporary profile:
ASAN_SYMBOLIZER_PATH=third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer \
ASAN_OPTIONS=detect_odr_violation=0:abort_on_error=1:symbolize=1 \
out/asan/chrome --user-data-dir=/tmp/agtm-poc-profile \
--enable-gpu-rasterization file:///ABSOLUTE/PATH/poc.html
- Wait for the first image raster task. The GPU process should terminate as
shown above. Save stdout/stderr as
asan.log.
Before the attached capture, the host was configured for the developer build's user namespace and verified with:
kernel.apparmor_restrict_unprivileged_userns = 0
unshare -Ur true -> exit 0
The attached asan.log was then produced with no --no-sandbox and no
--disable-gpu-sandbox. The outer timeout returned 124 only because the
browser remained alive after the GPU process exited; the GPU process itself
reported exit_code=4.
No custom harness, CDP, browser test, or unit-test executable is required.
Root cause
skia/public/mojom/hdr_metadata.mojom:65 declares an unbounded
alternate_images array. The traits read it without enforcing Skia's
kMaxNumAlternateImages = 4 limit. In
third_party/skia/src/codec/SkHdrAgtm.cpp, lines 412 and 416 allocate
H[5] and indices[5], while lines 417-429 iterate over the entire vector
and write H[N++]/indices[N].
The renderer simulation is guarded by --type=renderer; it changes neither
the GPU consumer nor the Skia code. The attached patch is not a proposed fix.
Attachments
Upload these as individual files:
poc.htmlcosmos1650_yuv444_10bpc_p3pq.avifrenderer_simulation.patchrepro.mdasan.log
The complete symbolized trace and all additional capture metadata are in
asan.log, not only in this report.
Suggested remediation
Enforce the maximum in the structured Mojo boundary and validate AGTM before Skia consumes it. Add regression coverage for 5 and 64 alternate images in the Mojo traits and GPU OOP-raster path.
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 Mojo traits for HDR metadata pass the alternate_images array through without enforcing Skia's limit of four, while Skia's AGTM code allocates fixed five-element arrays and iterates over the whole vector.
Impact
The GPU process crashed with an illegal instruction signal; the author explicitly does not claim remote code execution, instruction-pointer control or sandbox escape, and the malformed object required a renderer-side patch rather than plain web content.
What the attacker needed
Renderer-side simulation patch applied; custom ASan Chrome build; GPU rasterisation enabled
The fix
The maximum should be enforced at the structured Mojo boundary and AGTM validated before Skia consumes it, with regression tests for 5 and 64 alternate images.
How it was found
- Check out the stated Chromium revision and apply the renderer-only simulation patch, then build the ASan Chrome binary.
- Place the proof-of-concept HTML page next to the supplied AVIF image.
- Launch the full Chrome binary with a clean temporary profile and GPU rasterisation enabled.
- Wait for the first image raster task; the GPU process terminates with an illegal instruction signal.
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.
Images can carry extra metadata describing how to tone-map them for a display. One such format, AGTM, lists a few 'alternate' versions of the image, and the code reserves space for only four of them. The interface that passes this metadata along does not check the count, so a crafted list of 64 entries makes the program write past the end of its small arrays, which crashed the graphics process in the author's test build.
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.