WebM alpha BlockAdditional size confusion causes content-process crash with JS-created Blob
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: chanhokim0208, Assigned: karlt)
Details
(Keywords: csectype-nullptr, reporter-external, sec-low, Whiteboard: [adv-main150+])
Crash Data
Attachments
(3 files, 4 external files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Steps to reproduce:
-
Start a local HTTP server in
/home/test/neom/target_repo/firefox/layout/reftests/webm-video/.Example:
python3 -m http.server 8000 -
Open Firefox and visit:
http://127.0.0.1:8000/poc-alpha-blockadditional.html -
The page fetches
webm-alpha.webm, rewrites the firstBlockMoreelement in JavaScript, creates a malformedvideo/webmBlob, and assigns it to a normal<video>element. -
The tab crashes while loading the crafted WebM Blob.
Actual results:
Firefox crashes the tab/content process when a crafted WebM Blob is loaded through a normal <video> element.
This is reachable from web JavaScript only. No compromised child process or forged IPC is required.
The issue appears to be in WebM alpha additional-data handling. In media/libnestegg/src/nestegg.c, ne_read_block_additions() can record a nonzero BlockAdditional length even when no payload data was read for a large declared size. This leads to alphaData == NULL with alphaLength > 0.
Later, dom/media/webm/WebMDemuxer.cpp passes that pair into MediaRawData(data, length, alphaData, alphaLength), which reaches the alpha buffer copy path and crashes.
Observed impact so far: reliable JS-triggerable content-process denial of service.
Expected results:
Firefox should reject the malformed WebM file safely without crashing.
Malformed BlockAdditional metadata should cause a controlled media parse/decode failure. The demuxer should validate the declared size against the containing element and should not propagate a nonzero alpha-data length when no payload was actually read.
Comment 1•7 months ago
|
||
When I tried this locally, it looks like a null deref.
Comment 2•7 months ago
|
||
There's really no need to attach a zip file containing 2 files where one of them in a plain text file. Please attach the files directly to the bug.
Comment 3•7 months ago
|
||
Here's the crash I got when running this test case in Nightly: bp-74226f7a-eeeb-4ff0-94ed-2ae3c0260312
This can probably be unhidden, but I'll mark it sec-low for now to get it off of the triage list.
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 5•7 months ago
|
||
Comment 6•7 months ago
|
||
| Assignee | ||
Comment 7•7 months ago
|
||
nestegg_packet_additional_data() can return a non-zero length with a
null-pointer after failure to parse an ID_BLOCK_ADDITIONAL element.
https://github.com/mozilla/nestegg/issues/76
| Assignee | ||
Updated•7 months ago
|
Comment 9•7 months ago
|
||
Updated•7 months ago
|
| Assignee | ||
Comment 10•7 months ago
|
||
The test did crash without this, but is more thorough with a functional
reftest-wait and saves the same bug being copied to other tests.
| Assignee | ||
Comment 11•7 months ago
|
||
"When testing a pointer, use (!myPtr) or (myPtr)"
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#c-c-practices
Comment 12•7 months ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Comment 13•7 months ago
|
||
Comment 14•7 months ago
|
||
Comment 15•7 months ago
|
||
REFTEST TEST-UNEXPECTED-FAIL | dom/media/test/crashtests/2022746.html | load failed: timed out waiting for reftest-wait to be removed
Comment 16•7 months ago
|
||
Comment 17•7 months ago
|
||
| Assignee | ||
Comment 18•7 months ago
•
|
||
This is a safe null pointer content-process crash.
It does not need to be hidden as security sensitive.
The conditions for the crash are very unlikely to be encountered through the intended use of the API.
I don't think we need to patch this on ESR140, but a patch would be safe and easy, so please let me know if you'd like one.
Comment 19•7 months ago
|
||
Updated•7 months ago
|
Comment 20•7 months ago
|
||
Comment 21•7 months ago
|
||
Authored by https://github.com/karlt
https://github.com/mozilla/enterprise-firefox/commit/bcfaf2a6ececd7b92d1b93bc1e43a462d8807363
[enterprise-main] Bug 2022746 move reftest-wait to html element r=media-playback-reviewers,padenot
Updated•7 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•5 months ago
|
Updated•2 months ago
|
Description
•