Heap buffer overflow in ANGLE (CVE-2024-5159)
A GLSL shader with a switch statement containing many cases causes the SPIR-V Switch instruction to grow too large, triggering an assertion in ANGLE. An attacker could potentially crash the GPU process by supplying such a shader.
Originally disclosed on Chrome VRP
- Fix shipped in 34 days
Hi, I was able to hit the same assertion as issue 40945594. I'm not entirely sure about the exploitability of this to be honest but since it's very similar to the other issue I'm reporting this as a security issue.
A switch case inside he glsl shader code is translated to a spirv Switch operation. This operation grows in size with each case branch as it stores a target label and a literal to match against for each. Constructing a switch case with a lot of cases makes this operation too large and triggers this assertion: https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/common/spirv/spirv_instruction_builder_autogen.cpp;drc=bec40d7684688eaf8a5ca4747341dcea4243c996;l=25
The following steps reproduce this issue for me on asan-linux-debug-1289349:
- Download poc.html
- Run python -m http.server in the same directory as poc.html
- Run ASAN_OPTIONS=detect_odr_violation=0 ./chrome -use-gl=angle -use-angle=swiftshader --user-data-dir=/tmp/testuser http://localhost:8000/poc.html
VERSION Chrome Version: 126.0.6427.0 (Developer Build) (64-bit)
REPRODUCTION CASE see poc.html
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: gpu process assertion
CREDIT INFORMATION Reporter credit: David Sievers (@loknop)
**[Security shepherd update]: Note the updated PoC in comment#5 **
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
Impact
Could crash the GPU process, potentially leading to a denial of service.
What the attacker needed
Victim visits a malicious webpage
How it was found
- Download the proof-of-concept HTML file.
- Start a local HTTP server in the same directory.
- Run Chrome with specific flags to load the page and trigger the crash.
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 shader is a small program that runs on the graphics card. When a shader has a switch statement with many cases, the code that translates it to another format becomes too big and hits a safety check, crashing the graphics process. This could let a malicious website crash your browser's graphics component.
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.