Many uses of TypedArray::Create don't handle failures correctly
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
People
(Reporter: evilpies, Assigned: peterv)
References
Details
(Keywords: reporter-external, sec-audit, sec-moderate, Whiteboard: [adv-main121+])
Attachments
(4 files)
Looking at the uses of TypedArray::Create it seems to me like many either don't really consider this API fallible at all or don't clear the pending exception properly.
Considering how many problematic uses there are, even in some abstractions like CryptoBuffer::ToArrayBuffer, we should consider changing this API. I imagine we could change it to have an ErrorResult parameter by stealing the exception internally?
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
Without a specific PoC it's hard to call this sec-high, but boy does this smell like trouble brewing. In the cryptobuffer case the webauthn buffers are small enough that if you're that close to OOM there's likely lots of other failing things. But I bet there are other features with more user-defined data could be easier to trigger.
Comment 2•2 years ago
|
||
Peter, is this something that your TypedArray patches will fix?
| Assignee | ||
Comment 3•2 years ago
|
||
No, but it was next on my things I want to look at for TypedArray.
Comment 4•2 years ago
|
||
Peter, feel free to change if you think severity should be higher.
| Assignee | ||
Comment 5•2 years ago
|
||
| Assignee | ||
Comment 6•2 years ago
|
||
Depends on D191416
| Assignee | ||
Comment 7•2 years ago
|
||
Depends on D191417
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Push with mochitest failures
Failure log
TEST-UNEXPECTED-FAIL | dom/tests/mochitest/gamepad/test_gamepad_extensions.html | correct touch surfaceDimensions - got false, expected true
TEST-UNEXPECTED-FAIL | dom/tests/mochitest/gamepad/test_gamepad_multitouch_crossorigin.html | correct touch surfaceDimensions - got false, expected true
Push with hazard failure
Failure log
TEST-UNEXPECTED-FAIL | hazards | unrooted 'array' of type 'JS::TypedArray<JS::Scalar::Uint8>' live across GC call at dist/include/mozilla/dom/TypedArray.h:742
Comment 11•2 years ago
|
||
Comment 12•2 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/695789b9b326
https://hg.mozilla.org/mozilla-central/rev/4efe82747dc2
https://hg.mozilla.org/mozilla-central/rev/29fb30143955
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Bulk-unhiding security bugs fixed in Firefox 119-121 (Fall 2023). Use "moo-doctrine-subsidy" to filter
Comment 15•1 year ago
|
||
Sorry for the burst of bugspam: filter on tinkling-glitter-filtrate
Adding reporter-external keyword to security bugs found by non-employees for accounting reasons
Description
•