Insufficient validation of untrusted input in Codecs (CVE-2026-11095)
The Mojo service and VA-API encoder initialisation fail to validate the dimensions of spatial layers supplied by a compromised renderer. An attacker could supply a small base resolution with an extremely large spatial layer, causing integer truncation and a potential heap out-of-bounds write in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 57 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: A compromised renderer can bypass Mojo dimension checks by supplying a small base resolution and maliciously large spatial layer resolutions in the VideoEncodeAccelerator config. This causes the VA-API hardware driver to allocate a small context but process a massive frame, leading to a potential heap out-of-bounds write in the GPU process.
Affected files:
media/gpu/vaapi/vp9_vaapi_video_encoder_delegate.ccmedia/gpu/vaapi/vaapi_video_encode_accelerator.ccmedia/mojo/mojom/video_encode_accelerator_mojom_traits.ccmedia/mojo/services/mojo_video_encode_accelerator_service.ccmedia/gpu/vaapi/vaapi_wrapper.cc
Estimated timestamp from git blame: 2025-03-26
Description
A vulnerability exists in the VP9 VA-API video encoding implementation where a compromised renderer can potentially trigger a heap out-of-bounds (OOB) write in the GPU process. The issue arises from a failure to validate the dimensions of spatial_layers provided by the renderer during encoder initialization.
Technical Details
- Validation Bypass: In
media/mojo/services/mojo_video_encode_accelerator_service.cc,MojoVideoEncodeAcceleratorService::Initializevalidatesconfig.input_visible_sizeagainstmedia::limits::kMaxDimensionandlimits::kMaxCanvas. However, it does not perform any validation on the dimensions of the elements within theconfig.spatial_layersarray. - Hardware Profile Bypass: Similarly,
VaapiVideoEncodeAccelerator::Initializeverifies thatspatial_layersare sorted by size but fails to check their individual dimensions against the maximum supported resolution of the hardware profile. - Mismatched Initialization:
VP9VaapiVideoEncoderDelegate::Initializeextracts these unvalidatedspatial_layersdimensions. The encoder then creates a VA-API context and allocates output buffers sized according to the small, validatedinput_visible_size. - Implicit Truncation and OOB: During frame submission,
VP9VaapiVideoEncoderDelegate::SubmitFrameParameterscopies the spatial layer dimensions to theVAEncPictureParameterBufferVP9fields (frame_width_src,frame_height_src, etc.). Because the attacker can provide anint32_tvalue likeINT_MAX, and the VA-API parameter fields areuint16_t, the value is truncated (e.g.,INT_MAXbecomes65535). The VA-API driver is then instructed to process a massive 65535x65535 frame within internal context buffers allocated for a much smaller resolution (e.g., 320x240), causing a potential GPU heap out-of-bounds write.
Suggested Attacker Steps
Note: These are potential steps for triggering the vulnerability, as our tooling agent currently lacks the ability to execute code or build a working proof of concept.
- From a compromised renderer process on a platform utilizing VA-API (e.g., ChromeOS, Linux), request a
mojom::VideoEncodeAcceleratorinterface. - Call the
Initializemethod with a maliciously craftedVideoEncodeAcceleratorConfig. - Set
input_visible_sizeto a completely valid, small resolution (e.g., 320x240) to bypass Mojo's base dimension checks. - Add a single element to the
spatial_layersarray. Because it is a single element, it easily bypasses thestd::ranges::is_sortedcheck in the GPU process. - Set the
widthandheightof this spatial layer to0x7FFFFFFF(INT_MAX). - Submit a video frame for encoding. The VA-API driver will receive picture parameters for a 65535x65535 frame but will execute the encode on a 320x240 heap context.
Suggested Fix
- Mojo Service Validation: In
MojoVideoEncodeAcceleratorService::Initialize, iterate overconfig.spatial_layersand validate that each layer'swidthandheightdo not exceedlimits::kMaxDimension, and that the calculated area does not exceedlimits::kMaxCanvas. - VEA Validation: In
VaapiVideoEncodeAccelerator::Initialize, ensure that all provided spatial layer dimensions are less than or equal to the selected profile'smax_resolution. - Ensure spatial layer dimensions are strictly constrained by and validated against the base
input_visible_sizewhere appropriate.
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 validates the base input dimensions but never checks the dimensions of individual spatial layers, and later truncates a 32-bit value into a 16-bit driver field.
Impact
A compromised renderer could potentially trigger a heap out-of-bounds write in the GPU process, though the report notes the steps are potential and no working proof of concept was built.
What the attacker needed
Compromised renderer process; VA-API platform such as ChromeOS or Linux
The fix
The Mojo service and VA-API encoder should validate each spatial layer's dimensions against the maximum dimension, canvas area and hardware profile resolution.
How it was found
- From a compromised renderer on a VA-API platform, request the video encode accelerator interface.
- Call Initialize with a crafted config whose input_visible_size is a small valid resolution.
- Add one spatial layer with width and height set to INT_MAX to bypass the sorted check.
- Submit a frame so the driver receives 65535x65535 picture parameters for a 320x240 context.
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 web browser splits its work into isolated processes, and a compromised renderer is one that an attacker already controls. This report says that such a renderer can send video-encoding settings with a tiny overall size but a huge internal layer size, and the GPU process trusts those numbers without checking them. The huge number gets cut down to a smaller value when passed to the graphics driver, which then writes past the end of a buffer sized for the tiny resolution.
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.