SEGV on unknown address with very high WGSL group binding index
A WebGPU shader with a binding index far above the maximum allowed value caused a segmentation fault in the Vulkan driver when Firefox created a descriptor set layout. An attacker could crash the browser process by supplying such a shader.
Originally disclosed on Mozilla
- Fixed in 55 days
- Paid in 2 months
- Disclosed after 55 days
Created attachment 9510801
SEGV-e8cc-createdescriptorsetlayout-createbindgrouplayout.html
Tested on:
OS: Ubuntu 24.04
Firefox: fuzzfetch fetched --asan --fuzzing
> Task ID: GBCaDi1mT-6BdjWafeV9Jw
> Rank: 1756806487
> Changeset: cde4cacceebc4e36c6bf2d53166ee0b8922596c6
> Build ID: 20250902094807
Test case defines: '@group(0) @binding(390000000) var<uniform> uni: Uniforms;' in the shader code. Binding index is far outside of the maxBindingsPerBindGroup. Decreasing the index will prevent the crash.
FYI, There is a spike in memory usage before the crash, which made me think about bug 1927289, which is about OOM triggering bad behavior.
ASAN-trace:
'''
Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: WebGPU: disabling SharedTexture swapchain:
missing GBM_FORMAT_ARGB8888 dmabuf format (t=10.9189) [GFX1-]: WebGPU: disabling SharedTexture swapchain:
missing GBM_FORMAT_ARGB8888 dmabuf format
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2640822==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7fff3b107ded bp 0x7fff9da62b10 sp 0x7fff9da62a30 T43)
==2640822==The signal is caused by a READ memory access.
==2640822==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x7fff3b107ded (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x107ded) (BuildId: 4c73d51a265843a977afae4f4bc51b884f49b0ae)
#1 0x7fffe4987e5a in ash::device::Device::create_descriptor_set_layout::h331a067e512a93f3 /builds/worker/checkouts/gecko/third_party/rust/ash/src/device.rs:1567:9
#2 0x7fffe4987e5a in wgpu_hal::vulkan::device::_$LT$impl$u20$wgpu_hal..Device$u20$for$u20$wgpu_hal..vulkan..Device$GT$::create_bind_group_layout::h3e59838ad15b4b65 /builds/worker/checkouts/gecko/third_party/rust/wgpu-hal/src/vulkan/device.rs:1582:13
#3 0x7fffe405d179 in _$LT$D$u20$as$u20$wgpu_hal..dynamic..device..DynDevice$GT$::create_bind_group_layout::hd54f96023492a589 /builds/worker/checkouts/gecko/third_party/rust/wgpu-hal/src/dynamic/device.rs:278:18
#4 0x7fffe4775bb7 in wgpu_core::device::resource::Device::create_bind_group_layout::h20fa3847b8a7929c /builds/worker/checkouts/gecko/third_party/rust/wgpu-core/src/device/resource.rs:2462:28
#5 0x7fffe4218afa in wgpu_core::device::resource::Device::derive_pipeline_layout::_$u7b$$u7b$closure$u7d$$u7d$::h2fbed99cd79def53 /builds/worker/checkouts/gecko/third_party/rust/wgpu-core/src/device/resource.rs:3440:31
.
.
.
#42 0x5555556b7766 in asan_thread_start(void*) /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:239:28
#43 0x7ffff789caa3 in start_thread nptl/pthread_create.c:447:8
#44 0x7ffff7929c3b in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
==2640822==Register values:
rax = 0x0000000000000006 rbx = 0x000050300265ac50 rcx = 0x0000000000000000 rdx = 0x0000000000000010
rdi = 0x00000000173eed80 rsi = 0x00000000a2b87e80 rbp = 0x00007fff9da62b10 rsp = 0x00007fff9da62a30
r8 = 0x00007fff9bfadfb0 r9 = 0x000050300265ac50 r10 = 0x0000000000000000 r11 = 0x00000000173eed80
r12 = 0x0000000000000000 r13 = 0x00007ffddcbe2800 r14 = 0x0000000000000001 r15 = 0x0000000000000001
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x107ded) (BuildId: 4c73d51a265843a977afae4f4bc51b884f49b0ae)
Thread T43 created by T0 here:
#0 0x5555556a0d41 in pthread_create /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:250:3
#1 0x7ffff7a80419 in _PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:429:10
#2 0x7ffff7a6e65e in PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:496:10
#3 0x7fffd3f74291 in nsThread::Init(nsTSubstring<char> const&) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:615:20
.
.
.
#46 0x7ffff782a28a in __libc_start_main csu/../csu/libc-start.c:360:3
#47 0x55555561dc08 in _start (/home/attekett/Downloads/firefox/firefox+0xc9c08) (BuildId: f4ce53d20295d096e0db42c97c1cb980d797f317)
==2640822==ABORTING
'''
For WebGL firefox shows:
'''
WebGL 1 Driver Renderer NVIDIA Corporation -- NVIDIA GeForce RTX 3090/PCIe/SSE2
WebGL 1 Driver Version 4.6.0 NVIDIA 550.163.01
'''
But for WebGPU
'''
WebGPU Default Adapter {
"navigator.gpu.requestAdapter({})": {
"info": {
"architecture": "",
"description": "",
"device": "",
"isFallbackAdapter": false,
"subgroupMaxSize": 128,
"subgroupMinSize": 4,
"vendor": "",
"wgpuBackend": "Vulkan",
"wgpuDevice": 5056,
"wgpuDeviceType": "IntegratedGpu",
"wgpuDriver": "radv",
"wgpuDriverInfo": "Mesa 25.0.7-0ubuntu0.24.04.1",
"wgpuName": "AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)",
"wgpuVendor": 4098
},
"features": [
"bgra8unorm-storage",
"core-features-and-limits",
"depth-clip-control",
"depth32float-stencil8",
"float32-filterable",
"indirect-first-instance",
"rg11b10ufloat-renderable",
"shader-f16",
"texture-compression-bc",
"texture-compression-bc-sliced-3d",
"timestamp-query"
],
"limits": {
"maxBindGroups": 8,
"maxBindGroupsPlusVertexBuffers": 24,
"maxBindingsPerBindGroup": 1000,
"maxBufferSize": 1073741824,
"maxColorAttachmentBytesPerSample": 32,
"maxColorAttachments": 8,
"maxComputeInvocationsPerWorkgroup": 1024,
"maxComputeWorkgroupSizeX": 1024,
"maxComputeWorkgroupSizeY": 1024,
"maxComputeWorkgroupSizeZ": 1024,
"maxComputeWorkgroupStorageSize": 65536,
"maxComputeWorkgroupsPerDimension": 65535,
"maxDynamicStorageBuffersPerPipelineLayout": 8,
"maxDynamicUniformBuffersPerPipelineLayout": 16,
"maxInterStageShaderVariables": 16,
"maxSampledTexturesPerShaderStage": 64,
"maxSamplersPerShaderStage": 64,
"maxStorageBufferBindingSize": 1073741824,
"maxStorageBuffersPerShaderStage": 64,
"maxStorageTexturesPerShaderStage": 64,
"maxTextureArrayLayers": 2048,
"maxTextureDimension1D": 16384,
"maxTextureDimension2D": 16384,
"maxTextureDimension3D": 2048,
"maxUniformBufferBindingSize": 1073741824,
"maxUniformBuffersPerShaderStage": 64,
"maxVertexAttributes": 32,
"maxVertexBufferArrayStride": 2048,
"maxVertexBuffers": 16,
"minStorageBufferOffsetAlignment": 32,
"minUniformBufferOffsetAlignment": 32
}
}
}
'''
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 WebGPU implementation did not validate the binding index against maxBindingsPerBindGroup before passing it to the Vulkan driver, which then dereferenced an out-of-range value.
Impact
A web page could crash the browser process on systems using the affected Vulkan driver; the report does not claim code execution.
What the attacker needed
WebGPU enabled in Firefox; Vulkan backend with radv driver; Victim loads a crafted page
How it was found
- Open the attached test case in a Firefox build with WebGPU enabled.
- The shader declares a uniform binding with an index far above the limit.
- The browser crashes with a segmentation fault in the Vulkan driver.
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.
WebGPU lets web pages run code on the graphics card. A shader is a small program for the graphics card, and it declares slots (bindings) for data. This report shows that a shader asking for a slot number far beyond the allowed limit made the graphics driver read from a bad memory address, which crashed the browser.
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.