Inappropriate implementation in Dawn (CVE-2024-5834)
A crafted WGSL shader causes the Tint compiler to generate duplicate non-aggregate type declarations in SPIR-V output, leading to a crash. An attacker could potentially exploit this to cause a denial of service in applications that compile untrusted shaders.
Originally disclosed on Chrome VRP
- Fix shipped in 17 days
REPRODUCE
- gn gen out/libfuzzer --args="use_libfuzzer=true tint_build_cmds=true"
- ninja -C out/libfuzzer tint_wgsl_fuzzer
- out/libfuzzer/tint_wgsl_fuzzer poc.wgsl
CRASH LOG
For the full content, refer to log.txt. This is just a summary.
spirv:1:1 error: Duplicate non-aggregate type declarations are not allowed. Opcode: TypeImage id: 26
%26 = OpTypeImage %uint 1D 0 0 0 2 R32ui
Note
From this issue, it can be seen that this is the new SPIR-V writer currently being used for Android: https://issues.chromium.org/issues/340992052#comment15
CRASH INFO AND CREDIT
Type of crash: gpu
Reporter credit: gelatin dessert
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 SPIR-V writer in Tint fails to deduplicate non-aggregate type declarations, resulting in invalid SPIR-V that triggers a crash.
Impact
A crafted shader could cause a crash (denial of service) in applications that compile untrusted WGSL shaders, such as web browsers or Android components using the new SPIR-V writer.
What the attacker needed
Ability to supply a crafted WGSL shader
How it was found
- Generate build files for the fuzzer using gn.
- Build the tint_wgsl_fuzzer target with ninja.
- Run the fuzzer with the provided proof-of-concept WGSL file.
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.
This report describes a bug in a shader compiler called Tint, which turns a language called WGSL into another language called SPIR-V. When given a specially crafted shader file, the compiler produces invalid output that contains duplicate type definitions, causing it to crash. This could let an attacker crash software that processes shaders from untrusted sources.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.