Inappropriate implementation in Tint (CVE-2026-9918)
The mitigation for an AMD Mesa driver memory corruption bug in Dawn/Tint only handles 32-bit floats, so a WebGPU shader using 16-bit floats can bypass it. An attacker could re-trigger the GPU process crash and potentially achieve a sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
Flapjack, 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 mitigation for an AMD Mesa driver bug (crbug.com/448294721) in Dawn/Tint incorrectly only covers 32-bit floats. By using 16-bit floats (f16) in WebGPU shaders, an attacker can bypass this polyfill. This allows re-triggering a memory corruption crash in the GPU process, potentially leading to a sandbox escape.
Affected files:
third_party/dawn/src/tint/lang/spirv/writer/raise/unary_polyfill.ccthird_party/dawn/src/tint/lang/spirv/writer/raise/unary_polyfill.h
Estimated timestamp from git blame: 2025-12-01
Background
The AMD Mesa ACO optimizer contains a known vulnerability (tracked as crbug.com/448294721) that results in memory corruption (a 'wild-deref' in aco::combine_instruction) when attempting to fold floating-point modifiers like negation (fneg) or absolute value (fabs) into cross-lane subgroup instructions.
Dawn/Tint implemented a mitigation for this issue via UnaryPolyfill, which replaces these operations with bitwise manipulation (XOR 0x80000000 for negation and AND 0x7FFFFFFF for absolute value) before emitting SPIR-V for Vulkan. This prevents the driver's optimizer from folding the modifiers into subgroup primitives, avoiding the crash.
Vulnerability Details
The implementation of this mitigation in third_party/dawn/src/tint/lang/spirv/writer/raise/unary_polyfill.cc is incomplete because it explicitly checks for 32-bit floats (f32) while ignoring 16-bit floats (f16).
The current implementation explicitly checks for f32 (lines 53-54 and 58-59):
if (config.polyfill_f32_negation && unary->Op() == core::UnaryOp::kNegation &&
unary->Result()->Type()->DeepestElement()->Is<core::type::F32>()) {
// ...
}
// ...
if (config.polyfill_f32_abs && builtin->Func() == core::BuiltinFn::kAbs &&
builtin->Result()->Type()->DeepestElement()->Is<core::type::F32>()) {
// ...
}
WebGPU supports the shader-f16 extension, and modern AMD GPUs support both f16 types and subgroup operations (verified in DeviceVk.cpp and PhysicalDeviceVk.cpp). AMD hardware uses the same VOP3 instruction encodings and modifier logic for both 32-bit and 16-bit operands. Consequently, the same Mesa driver vulnerability can be triggered using 16-bit modifiers.
If an attacker provides a WebGPU shader using f16 types, Tint will bypass the polyfill and emit native OpFNegate or OpFAbs instructions. The Mesa driver will then attempt to fold these 16-bit modifiers into the subgroup primitive, re-triggering the memory corruption in the GPU process during compilation.
Potential Attack Scenario
Note: These are potential steps, as our tooling agent does not have the ability to run code to verify the exploit end-to-end.
- An attacker crafts a malicious webpage that sets up a WebGPU context, requesting a device with both the
shader-f16andsubgroupsfeatures enabled. - The attacker provides a compute shader that explicitly enables these features:
enable f16; enable subgroups;. - The shader contains a subgroup built-in function, passing a negated 16-bit float value, e.g.,
let val = f16(1.0); let result = subgroupMin(-val);. - Tint lowers this to IR. Because the negation is on an
f16type, theUnaryPolyfillpass skips it. - The SPIR-V printer emits a raw
OpFNegateinstruction. - The un-polyfilled SPIR-V is passed to the Vulkan driver (Mesa RADV) in the GPU process.
- The buggy ACO optimizer in Mesa attempts to fold the 16-bit
fneginto the subgroup operation, triggering the wild dereference. - With careful control over shader complexity and memory allocations, an attacker could potentially turn this compilation-time memory corruption into arbitrary code execution, achieving a renderer-to-GPU sandbox escape.
Suggested Fix
The UnaryPolyfill should be extended to handle f16 types when the mitigation is active.
- The checks in
Process()should be updated to allowf16types (e.g., usingIsAnyOf<core::type::F32, core::type::F16>()). - The polyfill logic in
PolyfillF32NegationandPolyfillF32Absshould be renamed and updated to use 16-bit bitwise masks (0x8000_ufor negation and0x7FFF_ufor absolute value) when processingf16operands. Alternatively, separate functions could be added forf16. - Ensure
ty.MatchWidthandb.Bitcastcorrectly handle mappingf16elements tou16before applying the masks.
Evaluated with Chrome root at commit: 09ec9e7cc4d24823d20b6d37cf3d282734f6bf0f
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 UnaryPolyfill mitigation only checks for 32-bit float types and ignores 16-bit floats, so f16 negation and absolute value are emitted natively and reach the vulnerable driver optimiser.
Impact
An attacker could re-trigger a memory corruption crash in the GPU process and potentially turn it into arbitrary code execution, achieving a renderer-to-GPU sandbox escape; the report notes these steps are potential and were not verified end-to-end.
What the attacker needed
WebGPU with shader-f16 and subgroups; AMD GPU with Mesa RADV driver; Victim visits a malicious webpage
The fix
The UnaryPolyfill should be extended to handle f16 types, using 16-bit bitwise masks for negation and absolute value and ensuring bitcasts map f16 elements to u16 before applying the masks.
How it was found
- Craft a webpage that sets up a WebGPU context and requests a device with the shader-f16 and subgroups features.
- Provide a compute shader that enables f16 and subgroups.
- Include a subgroup built-in function that receives a negated 16-bit float value.
- Tint lowers the shader to IR and the UnaryPolyfill pass skips the f16 negation.
- The SPIR-V printer emits a raw OpFNegate instruction.
- The un-polyfilled SPIR-V is passed to the Mesa RADV driver, whose ACO optimiser folds the 16-bit negation into the subgroup operation and triggers the wild dereference.
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 graphics driver has a bug that can crash when it optimises certain floating-point operations. A fix in the browser's shader compiler only covered one number type, so using a smaller number type slips past the fix and hits the same driver bug. This could crash the graphics process and, in theory, let an attacker escape the browser's 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.