Type Confusion in Tint (CVE-2026-14423)
When the pixel-center polyfill is active, Tint assigns the polyfill interpolant location independently per shader stage by picking the lowest unused location. Because WebGPU allows fragment inputs to be a subset of vertex outputs, the vertex and fragment stages can pick different locations, producing a mismatched SPIR-V interface that may cause undefined behaviour or memory corruption in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 34 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: When the pixel-center polyfill is active, Dawn/Tint independently assigns the polyfill interpolant location for each shader stage by scanning for the lowest unused location index. Because WebGPU allows fragment inputs to be a strict subset of vertex outputs, the vertex and fragment compilers can resolve different locations for the polyfill variable. This discrepancy can result in a mismatched SPIR-V interface being passed directly to the Vulkan driver, potentially triggering undefined behavior or memory corruption in the GPU process.
Affected files:
third_party/dawn/src/tint/lang/spirv/writer/raise/shader_io.cc
Estimated timestamp from git blame: 2025-11-13
Description
When polyfill_pixel_center is enabled (for instance, when multisample.count > 1 and the fragment shader uses @builtin(position) alongside a sample-interpolated input or @builtin(sample_index)), the function AddCenterPosInterpolant in third_party/dawn/src/tint/lang/spirv/writer/raise/shader_io.cc is invoked once per shader stage.
This function selects the smallest location index absent from the current stage's input/output list:
std::set<uint32_t> existing_locations;
for (auto io : entries) {
if (io.attributes.location.has_value()) {
existing_locations.insert(io.attributes.location.value());
}
}
uint32_t free_location = 0u;
for (uint32_t i = 0u; i < (existing_locations.size() + 1); i++) {
if (existing_locations.find(i) == existing_locations.end()) {
free_location = i;
break;
}
}
However, WebGPU validation permits the fragment stage inputs to be a strict subset of the vertex stage outputs (as validated in ValidateInterStageMatching in RenderPipeline.cpp). Because stages are compiled in isolation without sharing location allocation metadata, the vertex and fragment compilation passes can resolve different "smallest free" locations for the center_pos polyfill variable.
Potential Attack Scenario
An attacker seeking to trigger this mismatch would potentially perform the following steps from web content:
-
Request a WebGPU adapter and device on a platform using the Vulkan backend (e.g., Android, Linux, or Windows).
-
Create a shader module containing a vertex shader that outputs multiple locations (e.g., location 0 and location 1):
WGSL struct VOut { @builtin(position) p: vec4<f32>, @location(0) a: vec4<f32>, @location(1) @interpolate(flat) b: i32 }; @vertex fn vs() -> VOut { ... } -
Create a fragment shader module that only consumes a subset of those outputs (e.g., only location 0) and uses
@builtin(sample_index)(or sample interpolation) and@builtin(position)to trigger the pixel-center polyfill:WGSL @fragment fn fs( @builtin(position) p: vec4<f32>, @builtin(sample_index) s: u32, @location(0) a: vec4<f32> ) -> @location(0) vec4<f32> { return p + a; } -
Create a render pipeline with
multisample: {count: 4}using these modules.
During compilation:
- The vertex shader's polyfill scans locations
{0, 1}and assignscenter_posto Location 2. - The fragment shader's polyfill scans location
{0}and assignscenter_posto Location 1.
Consequently, the vertex shader outputs a flat i32 at Location 1, whereas the fragment shader expects a NoPerspective vec4<f32> at Location 1. This mismatch violates Vulkan's inter-stage interface-matching rules (VUID-RuntimeSpirv-OpEntryPoint-07754 and VUID-RuntimeSpirv-OpEntryPoint-08743).
When the mismatched SPIR-V modules are sent directly to vkCreateGraphicsPipelines, it can lead to Vulkan driver undefined behavior. Depending on the driver and hardware, this could cause pipeline creation failure, garbage interpolation reads, or potential memory corruption inside the GPU process.
Note: These steps are based on source code analysis. Our tooling currently does not have the ability to run code or verify runtime behavior.
Suggested Remediation
Instead of resolving the polyfill location dynamically within each stage independently, Dawn should establish a unified inter-stage location assignment strategy during the pipeline compilation setup, or Tint should reserve a specific, universally agreed-upon location slot for internal polyfills that does not conflict with user-declared locations.
Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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
Likely the polyfill location is allocated per stage by scanning only that stage's own locations, with no shared inter-stage allocation, so a subset fragment input list yields a different 'lowest free' slot than the vertex output list.
Impact
The mismatched SPIR-V could cause pipeline creation failure, garbage interpolation reads, or potential memory corruption inside the GPU process, though the report notes the steps are from source analysis and runtime behaviour was not verified.
What the attacker needed
WebGPU access in the browser; Vulkan backend platform; multisample count above 1; fragment uses position and sample index
The fix
Dawn should use a unified inter-stage location assignment during pipeline setup, or Tint should reserve a fixed location slot for internal polyfills that cannot clash with user locations.
How it was found
- Request a WebGPU adapter and device on a Vulkan-backed platform.
- Create a vertex shader that outputs several locations.
- Create a fragment shader that consumes only a subset of those outputs and uses position plus sample index to trigger the polyfill.
- Create a render pipeline with multisample count 4 using these modules.
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 pipeline has two shader stages: a vertex shader that produces outputs and a fragment shader that consumes some of them. Each output/input has a numbered slot called a location, and the two stages must agree on what type sits in each slot. Here the compiler added an internal helper value to each stage separately and picked the first free slot in each, so the two stages disagreed about what was in that slot, which can confuse the graphics driver.
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.