Out of bounds read in Media (CVE-2026-8535)
The JPEG parser fails to validate the quantization table selector, allowing a compromised renderer to supply an out-of-bounds index to the VA-API hardware decoder. This can leak GPU process memory into the decoded image, aiding a sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 days
Flapjack (go/flapjack), an LLM-powered static analysis tool, has identified the following potential security issue.
Overview: A compromised renderer process can potentially trigger an out-of-bounds read in the GPU process by supplying a malicious JPEG to the hardware decoder. The JPEG parser fails to validate the quantization table selector, passing an arbitrary index to the VA-API driver. This can leak GPU memory contents back to the renderer through the decoded image.
Affected files:
media/parsers/jpeg_parser.ccmedia/gpu/vaapi/vaapi_jpeg_decoder.cc
Estimated timestamp from git blame: 2024-04-12
This issue allows a compromised renderer to potentially leak GPU process memory via an out-of-bounds read in the VA-API hardware decoder, aiding in a sandbox escape.
Technical Details
Standard Mojo IPC setup from a compromised renderer establishes a MjpegDecodeAccelerator session. The vulnerability occurs during the parsing of the JPEG bitstream.
When parsing the JPEG_SOF0 marker, media/parsers/jpeg_parser.cc reads the quantization_table_selector for each image component but does not enforce the 0-3 baseline limit:
// media/parsers/jpeg_parser.cc : ParseSOF()
READ_U8_OR_RETURN_FALSE(component.quantization_table_selector);
This unvalidated selector (which can be up to 255) is mapped directly to pic_param_components[i].quantiser_table_selector in media/gpu/vaapi/vaapi_jpeg_decoder.cc and passed to the third-party VA-API driver in the GPU process.
The VA-API driver uses this value to index the 4-element quantization table array (e.g., VAIQMatrixBufferJPEGBaseline). Providing an index > 3 results in a direct OOB read. The OOB memory is treated as quantization matrix data, mathematically embedding the leaked memory into the output decoded image pixels.
Potential Attacker Steps
(Note: These are suggested/potential steps, as the Flapjack LLM agent does not have the ability to run code to verify a working exploit).
- Gain code execution in a sandboxed renderer process.
- Bind the
viz::mojom::Gpuinterface and callCreateJpegDecodeAccelerator()to reach the GPU process. - Send a decode request containing a malicious JPEG with the
quantization_table_selectorset to an out-of-bounds value (e.g., 255) in the SOF0 marker. - Read the resulting decoded image buffer and reverse the IDCT/dequantization math to infer the OOB memory contents from the GPU process.
Suggested Fix
Add a bounds check in media/parsers/jpeg_parser.cc within the ParseSOF function to ensure the selector does not exceed the maximum allowed tables:
READ_U8_OR_RETURN_FALSE(component.quantization_table_selector);
if (component.quantization_table_selector >= kJpegMaxQuantizationTableNum) {
DVLOG(1) << "Invalid quantization table selector";
return false;
}
Evaluated with Chrome root at commit: 9760e6c70cd33a320713361f17c6dcca85648c0f
Results from Flapjack so far have been promising, but it can be wrong in its deductions. At this time, it does not produce proof of concepts or fuzzer tests. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve Flapjack’s 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 JPEG parser does not enforce the baseline limit of 0-3 on the quantization table selector before passing it to the VA-API driver.
Impact
A compromised renderer could potentially leak GPU process memory, aiding in a sandbox escape.
What the attacker needed
Code execution in a sandboxed renderer; access to the GPU process via Mojo IPC
The fix
A bounds check should be added in the JPEG parser to ensure the quantization table selector does not exceed the maximum allowed tables.
How it was found
- Gain code execution in a sandboxed renderer process.
- Bind the viz::mojom::Gpu interface and call CreateJpegDecodeAccelerator() to reach the GPU process.
- Send a decode request containing a malicious JPEG with the quantization_table_selector set to an out-of-bounds value in the SOF0 marker.
- Read the resulting decoded image buffer and reverse the IDCT/dequantization math to infer the OOB memory contents from the GPU process.
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 JPEG file contains a small number that tells the decoder which table to use for image compression. The software did not check that this number was within the allowed range, so a malicious file could make the decoder read memory outside the table. That leaked memory could then be hidden in the decoded image, potentially helping an attacker break out of a security sandbox.
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.