Parent Process (Unsandboxed) Out-Of-Bounds Write on WebGL vertexAttribDivisor
An out-of-bounds write occurs in the WebGL function gleLLVMStoreDataToOutFloatInFloat when processing a specific vertex attribute divisor, triggered by opening a crafted HTML file. This can corrupt the GPU process and potentially enable a sandbox escape.
- Fixed in 47 days
- Paid in 3 months
- Disclosed after 47 days
Created attachment 9420656 poc.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Steps to reproduce:
High-level overview of the vulnerability and the possible effect of using it
-
A Out-Of-Bounds Write Vulnerability exists in the WebGL gleLLVMStoreDataToOutFloatInFloat.
-
An attacker must open a arbitrary generated HTML file to exploit this vulnerability.
-
Exploiting this vulnerability can lead to a privileged process (GPU Process), enabling a sandbox escape.
- like : CVE-2023-6856 => Heap-Buffer-Overflow Sandbox Escape in Mozilla Firefox WebGL
Exact product that was found to be vulnerable including complete version information
-
OS : macOS Sonoma 14.5 / macOS Beta 15.0 (24A5289g) => Apple Macbook M1 Pro
-
Product : Mozilla Firefox 129.0.1
-
Important : Since this vulnerability is OS dependent, please test it on the M1 real machine using Apple's ARM silicon. (You may not be able to do this in a VM. The GPU configuration inside the VM is different from that of the real machine.)
Details
- If you check the LLDB below, you can see that
Out-Of-Bounds Writeoccurs while processing a specific implementation in thegleLLVMStoreDataToOutFloatInFloatfunction. While processing thestr s0, [x8]opcode, an overflow pointer exists inx8.
(lldb) process attach --pid 9338
Process 9338 stopped
* thread #1, name = 'MainThread', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x0000000189562e14 libsystem_kernel.dylib`mach_msg2_trap + 8
libsystem_kernel.dylib`mach_msg2_trap:
-> 0x189562e14 <+8>: ret
libsystem_kernel.dylib`macx_swapon:
0x189562e18 <+0>: mov x16, #-0x30 ; =-48
0x189562e1c <+4>: svc #0x80
0x189562e20 <+8>: ret
Executable module set to "/Applications/Firefox.app/Contents/MacOS/firefox".
Architecture set to: arm64-apple-macosx-.
(lldb) c
Process 9338 resuming
Process 9338 stopped
* thread #39, name = 'CanvasRenderer', queue = 'OpenGLMT', stop reason = EXC_BAD_ACCESS (code=1, address=0x14c7c8000)
frame #0: 0x00000001e4d85f1c GLEngine`gleLLVMStoreDataToOutFloatInFloat + 68
GLEngine`gleLLVMStoreDataToOutFloatInFloat:
-> 0x1e4d85f1c <+68>: str s0, [x8]
0x1e4d85f20 <+72>: cmp w9, #0x2
0x1e4d85f24 <+76>: b.lo 0x1e4d86048 ; <+368>
0x1e4d85f28 <+80>: str wzr, [x8, #0x4]
(lldb) bt
* thread #39, name = 'CanvasRenderer', queue = 'OpenGLMT', stop reason = EXC_BAD_ACCESS (code=1, address=0x14c7c8000)
* frame #0: 0x00000001e4d85f1c GLEngine`gleLLVMStoreDataToOutFloatInFloat + 68
frame #1: 0x00000001e4d84cd0 GLEngine`gleRunVertexSubmitImmediate + 3812
frame #2: 0x00000001e4d1f8b0 GLEngine`gleDrawArraysOrElements_ExecCore + 620
frame #3: 0x00000001e4d15d5c GLEngine`glDrawArraysInstanced_STD_GL3Exec + 544
frame #4: 0x00000001e4d15830 GLEngine`glDrawArrays_UnpackThread + 48
frame #5: 0x00000001e4d3db14 GLEngine`gleCmdProcessor + 120
frame #6: 0x00000001893f1660 libdispatch.dylib`_dispatch_client_callout + 20
frame #7: 0x0000000189400ce0 libdispatch.dylib`_dispatch_lane_barrier_sync_invoke_and_complete + 56
frame #8: 0x00000001e4ca3e94 GLEngine`glDeleteBuffers_ExecThread + 44
frame #9: 0x00000001179e8be8 XUL`___lldb_unnamed_symbol110786 + 60
frame #10: 0x00000001186d5f94 XUL`___lldb_unnamed_symbol166232 + 88
frame #11: 0x00000001186d6060 XUL`___lldb_unnamed_symbol166235 + 12
frame #12: 0x00000001186cc52c XUL`___lldb_unnamed_symbol166067 + 88
frame #13: 0x00000001186cf9d8 XUL`___lldb_unnamed_symbol166113 + 120
frame #14: 0x0000000118701dbc XUL`___lldb_unnamed_symbol167052 + 72
frame #15: 0x0000000118701d4c XUL`___lldb_unnamed_symbol167051 + 48
frame #16: 0x00000001186f1690 XUL`___lldb_unnamed_symbol166619 + 316
frame #17: 0x000000011872180c XUL`___lldb_unnamed_symbol167357 + 292
frame #18: 0x0000000115995904 XUL`___lldb_unnamed_symbol23592 + 104
frame #19: 0x0000000115656e6c XUL`___lldb_unnamed_symbol16979 + 892
frame #20: 0x00000001153ac568 XUL`___lldb_unnamed_symbol9329 + 2524
frame #21: 0x000000011565b644 XUL`___lldb_unnamed_symbol17010 + 376
frame #22: 0x000000011561d5e0 XUL`___lldb_unnamed_symbol16406 + 80
frame #23: 0x00000001153a3f94 XUL`___lldb_unnamed_symbol9262 + 304
frame #24: 0x00000001034d02f0 libnss3.dylib`___lldb_unnamed_symbol2291 + 260
frame #25: 0x00000001895a42e4 libsystem_pthread.dylib`_pthread_start + 136
(lldb) x/30gx $x8
error: memory read failed for 0x14c7c8000
Proof-of-Concept
- Open
poc.htmlin the attached file with Mozilla Firefox. (Apple M1 Pro Real-Machine) - Now, if the Browser Process is corrupted, it is capable of sandbox escape.
Deadline
This bug is subject to a 90-day disclosure deadline. If a fix for this issue is made available to users before the end of the 90-day deadline, this bug report will become public 30 days after the fix was made available. Otherwise, this bug report will become public at the deadline. The scheduled deadline is "2024-11-22"
CREDIT Information
- D7
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 an incorrect calculation of the destination buffer size or offset when storing vertex attribute data for instanced rendering, leading to a write beyond the allocated buffer.
Impact
Exploiting this vulnerability can lead to a privileged process (GPU Process), enabling a sandbox escape.
What the attacker needed
Victim opens a crafted HTML file; Apple M1 Pro real machine
How it was found
- Open the provided poc.html file in Mozilla Firefox on an Apple M1 Pro real machine.
- The browser process may become corrupted, potentially leading to a sandbox escape.
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 web page can use WebGL to draw 3D graphics. A bug in how Firefox handles a particular WebGL setting causes it to write data past the end of a memory buffer, which can crash or corrupt the graphics process. An attacker could use this to try to break out of 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.