Closed
Bug 656752
(CVE-2011-2367)
Opened 14 years ago
Closed 14 years ago
WebGL crash [@gleRunVertexSubmitImmediate()]
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox5 | + | fixed |
blocking2.0 | --- | ? |
status2.0 | --- | wanted |
status1.9.2 | --- | unaffected |
status1.9.1 | --- | unaffected |
People
(Reporter: posidron, Unassigned)
Details
(Keywords: crash, testcase, Whiteboard: [sg:high] arbitrary memory read [4.0.x ridealong?])
Crash Data
Attachments
(3 files)
6.59 KB,
application/zip
|
Details | |
12.54 KB,
text/plain
|
Details | |
1.64 KB,
patch
|
jrmuizel
:
review+
christian
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Environment:
ProductName: Mac OS X
ProductVersion: 10.6.7
BuildVersion: 10J869
OpenGL renderer string: NVIDIA GeForce GT 330M OpenGL Engine
OpenGL version string: 2.1 NVIDIA-1.6.26
and
OpenGL renderer string: ATI Radeon HD 6750M OpenGL Engine
OpenGL version string: 2.1 ATI-1.6.32
Reporter | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Bingo: I can reproduce on Linux:
https://crash-stats.mozilla.com/report/index/a58d28f4-8125-447b-8ff8-39d102110516
That means it's almost certainly a bug in my code.
Comment 3•14 years ago
|
||
Seems to be that the WebGL state tracking code is getting confused into believing that there is an element array buffer bound (mBoundElementArrayBuffer is non-null) when there really isn't.
Comment 4•14 years ago
|
||
Seems like you might be able to use this to upload arbitrary data to the gpu and then extract it's contents.
Group: core-security
Comment 5•14 years ago
|
||
Indeed... very scary.
Comment 6•14 years ago
|
||
There you go: bindBuffer() was updating its bookkeeping before parameter validation was complete. The testcase was hitting a case where the bookkeeping was updated but the corresponding GL call was not performed, so the bookkeeping was no longer reflecting the actual GL state.
Attachment #532684 -
Flags: review?(jmuizelaar)
Comment 7•14 years ago
|
||
(In reply to comment #4)
> Seems like you might be able to use this to upload arbitrary data to the gpu
> and then extract it's contents.
Just for the record, here's how an attack could have proceeded, to implement PEEK:
1. set up vertex data (bound vertex buffers) so that the i-th vertex contains the value i.
2. set up a trivial vertex shader that just copies the vertex, and a fragment shader that encodes the vertex x-coord as color
3. reproduce the situation hit by Christoph's test case, call glDrawElements drawing 1 vertex as GL_POINTS, with an 'indices' parameter equal to some pointer you want to read the memory at.
4. now your rendered pixel's color tells you what was at this memory location
Updated•14 years ago
|
Attachment #532684 -
Flags: review?(jmuizelaar) → review+
Updated•14 years ago
|
Attachment #532684 -
Flags: approval-mozilla-aurora?
Comment 8•14 years ago
|
||
For sure we want this in Firefox 5.
What do we do for Firefox 4? Is this worth a chemspill?
Note, regarding comment 7: there's one little mitigation of the severity of this bug, it's that this pointer parameter gets validated as an index into a vertex array, so if it's greater than the length of currently bound arrays, it gets rejected. Of course that's not enough to make one feel comfortable.
tracking-firefox5:
--- → ?
Comment 9•14 years ago
|
||
Important: this bug has been open for 1 day before getting hidden.
Comment 10•14 years ago
|
||
Ugh, been open for 4 days actually.
Comment 11•14 years ago
|
||
Comment on attachment 532684 [details] [diff] [review]
fix bindBuffer() bookkeeping
Approved for mozilla-aurora
Attachment #532684 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•14 years ago
|
status1.9.1:
--- → unaffected
status1.9.2:
--- → unaffected
status-firefox5:
--- → affected
Whiteboard: [sg:high] arbitrary memory read
Comment 12•14 years ago
|
||
If we did a 4.0.x chemspill it might be worth it to take this fix.
blocking2.0: --- → ?
Whiteboard: [sg:high] arbitrary memory read → [sg:high] arbitrary memory read [4.0.x ridealong?]
Comment 13•14 years ago
|
||
Can someone land this. We are soon going to merge over to Beta.
Comment 14•14 years ago
|
||
Landed on Mozilla-Aurora:
http://hg.mozilla.org/mozilla-aurora/rev/549dfefec7c0
But now I'm a bit scared: what if the bad guys are watching the logs?
Updated•14 years ago
|
Comment 15•14 years ago
|
||
Maybe I shouldn't land this on mozilla-central for now. In case the bad guys are watching only mozilla-central and not mozilla-aurora.
Comment 16•14 years ago
|
||
After discussion with Jeff and Ehsan, landed this on mozilla-central
http://hg.mozilla.org/mozilla-central/rev/db4ba8614fb6
Looking back at the patch, I find some relative comfort in the fact that it's only touching bindBuffer() and doesn't give away the clue that there was an exploit specifically with element array pointers i.e. the old OpenGL-1-ish signature of glDrawElements that's not supposed to be exposed by WebGL.
Comment 17•14 years ago
|
||
FIXED in firefox 5 and 6, but the question is still open for Firefox 4.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Assignee | ||
Updated•14 years ago
|
Crash Signature: [@gleRunVertexSubmitImmediate()]
Updated•14 years ago
|
Alias: CVE-2011-2367
Updated•14 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•