Closed Bug 2022746 (CVE-2026-6778) Opened 7 months ago Closed 7 months ago

WebM alpha BlockAdditional size confusion causes content-process crash with JS-created Blob

Categories

(Core :: Audio/Video: Playback, defect, P3)

Firefox 148
defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox148 --- wontfix
firefox149 --- wontfix
firefox150 + fixed

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:

  1. Start a local HTTP server in /home/test/neom/target_repo/firefox/layout/reftests/webm-video/.

    Example:
    python3 -m http.server 8000

  2. Open Firefox and visit:
    http://127.0.0.1:8000/poc-alpha-blockadditional.html

  3. The page fetches webm-alpha.webm, rewrites the first BlockMore element in JavaScript, creates a malformed video/webm Blob, and assigns it to a normal <video> element.

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

When I tried this locally, it looks like a null deref.

Group: firefox-core-security → media-core-security
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Attached file poc.html —

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.

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.

Keywords: sec-low
Status: UNCONFIRMED → NEW
Ever confirmed: true
Crash Signature: [@ mozilla::AlignedBuffer<T>::AlignedBuffer ]
Attached file poc.html —
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Attached file GitHub Pull Request —
Attachment #9553890 - Flags: review?(karlt)
Attached file (secure) —

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

Attachment #9553890 - Flags: review?(karlt) → review+
Group: media-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Attached file (secure) —

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.

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)

Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7dacf0411309 https://hg.mozilla.org/integration/autoland/rev/0ca6c72bb326 Revert "Bug 2022746 Convert pointer to boolean instead of comparing with 0 r=media-playback-reviewers,padenot" for causing crashtest failures.

REFTEST TEST-UNEXPECTED-FAIL | dom/media/test/crashtests/2022746.html | load failed: timed out waiting for reftest-wait to be removed

Flags: needinfo?(karlt)
Pushed by ktomlinson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/37fe0ba0f1b5 https://hg.mozilla.org/integration/autoland/rev/d61353b875f0 Convert pointer to boolean instead of comparing with 0 r=media-playback-reviewers,padenot

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.

Flags: needinfo?(dmeehan)

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

QA Whiteboard: [sec] [qa-triage-done-c151/b150]
Whiteboard: [adv-main150+]
Alias: CVE-2026-6778
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: