Closed
Bug 576020
Opened 14 years ago
Closed 14 years ago
OOB access when applying the slice() method to incorrect objects
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
status1.9.2 | --- | unaffected |
status1.9.1 | --- | unaffected |
People
(Reporter: serg.glazunov, Assigned: vlad)
Details
(Whiteboard: [sg:critical])
Attachments
(1 file)
1.32 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.2 (KHTML, like Gecko) Chrome/6.0.451.0 Safari/534.2 Build Identifier: Simple repro: a = Int8Array(0x1000000); b = Int32Array.prototype.slice.apply(a, [0, 0x1000000]); //We can now access 4 times more data than the array buffer contains. alert(b[0x1000000 - 1]); Clearly it can lead to arbitrary code execution. Reproducible: Always
Comment 1•14 years ago
|
||
What version of Firefox were you testing against?
Assignee: nobody → general
Component: Canvas: WebGL → JavaScript Engine
QA Contact: canvas.webgl → general
Whiteboard: [sg:critical]
Comment 2•14 years ago
|
||
bp-ffe619dc-3efc-44c7-a2a5-907ca2100630 on trunk
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
status1.9.1:
--- → unaffected
status1.9.2:
--- → unaffected
Ever confirmed: true
Assignee | ||
Comment 4•14 years ago
|
||
Man am I starting to hate dynamic languages.. slice() just needs to check that the array type is what it expects. Will patch tomorrow.
Assignee: general → vladimir
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•14 years ago
|
||
Here's the fix. We just add a check into slice().
Attachment #455574 -
Flags: review?(jorendorff)
Comment 6•14 years ago
|
||
Comment on attachment 455574 [details] [diff] [review] fix I think this bug is a duplicate of bug 571014. The fix is already in. The test is welcome, though, if we don't already have a test like that.
Attachment #455574 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 7•14 years ago
|
||
Not sure if it is -- slice() is the only method on typed arrays, so the only one that can be used with apply this way. The other bug was mainly dealing with properties, and just walks the proto chain until it finds a typed array. That will still succeed in this case, but it'll still be the wrong type. Also applying slice to a non-typed-array will likely walk the proto chain up to NULL (I guess?), and then the getPrivate() would crash.
Assignee | ||
Comment 8•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/8a745dc12044
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
blocking2.0: ? → betaN+
Reporter | ||
Updated•14 years ago
|
Summary: OOB access when incorrect array type created → OOB access when applying the slice() method to incorrect objects
Updated•13 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•