Closed Bug 1855550 (CVE-2023-5217) Opened 9 months ago Closed 9 months ago

Chrome libvpx 0day

Categories

(Core :: Audio/Video, defect)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
thunderbird_esr115 ? affected
firefox-esr115 118+ fixed
firefox118 + fixed
firefox119 + fixed
firefox120 + fixed

People

(Reporter: freddy, Assigned: RyanVM)

References

Details

(Keywords: csectype-bounds, reporter-external, sec-critical, Whiteboard: [adv-main118.0.1+][adv-esr115.3.1+])

Attachments

(6 files, 3 obsolete files)

Chrome is affected by a 0day bug exploiting a vulnerability in libvpx, which is exposed through the WebCodec API.

We do not support the API but use libvpx elsewhere (mostly WebRTC) and should therefore investigate if this affects us and how fast we want to ship an update.

I'm rating this sec-critical, in case it is a Firefox 0day. Naturally, we want to rank this down if it isn't.

Attached file gtest diff

We are not vulnerable to the Chrome exploit that's in the wild, which uses Web Codecs APIs that Firefox does not support (yet). But WebRTC can encode using VP8 and it's possible the bug could be triggered in Firefox by manipulating input streams to that.

Update: we later discovered that the MediaRecorder API also uses the vulnerable libvpx encoder, and we believe it could be used to trigger the vulnerability in Firefox.

Attached file Bug 1855550 - Add test. (obsolete) —

I'll mark this as csectype-bounds, as the description of this from Chrome's release notes is:
"[1486441] High CVE-2023-5217: Heap buffer overflow in vp8 encoding in libvpx. Reported by Clément Lecigne of Google's Threat Analysis Group on 2023-09-25"

Keywords: csectype-bounds
Assignee: nobody → ryanvm
Status: NEW → ASSIGNED
Attachment #9355424 - Attachment is obsolete: true

Comment on attachment 9355423 [details]
Bug 1855550 - VP8: disallow thread count changes.

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: I assume not hard given the 0-day for chrome (if they figure out that MediaRecorder could be a vector, and MediaRecorder actually triggers it in an exploitable way)
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Yes
  • Which older supported branches are affected by this flaw?: all
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: No
  • If not, how different, hard to create, and risky will they be?: trivial
  • How likely is this patch to cause regressions; how much testing does it need?: Almost impossible to cause regressions
  • Is Android affected?: Yes

Beta/Release Uplift Approval Request

  • User impact if declined: active 0-day
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Trivial safe change
  • String changes made/needed: none
  • Is Android affected?: Yes
Attachment #9355423 - Flags: sec-approval?
Attachment #9355423 - Flags: approval-mozilla-release?
Summary: Chrome libvpx 0day - might affect Firefox → Chrome libvpx 0day

Comment on attachment 9355423 [details]
Bug 1855550 - VP8: disallow thread count changes.

Per discussion in the incident Slack channel, we're going to move forward with shipping this fix ASAP. Approved for 118.0.1, 119.0b3, and 115.3.1esr.

Attachment #9355423 - Flags: sec-approval?
Attachment #9355423 - Flags: sec-approval+
Attachment #9355423 - Flags: approval-mozilla-release?
Attachment #9355423 - Flags: approval-mozilla-release+
Attachment #9355423 - Flags: approval-mozilla-esr115+
Attachment #9355423 - Flags: approval-mozilla-beta+
Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c53f5ef77b62
VP8: disallow thread count changes. r=jesup
Attached file advisory.txt (obsolete) —
Attached file advisory.txt (obsolete) —
Attachment #9355446 - Attachment is obsolete: true
Attached file advisory.txt
Attachment #9355449 - Attachment is obsolete: true
Alias: CVE-2023-5217
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch

(In reply to Daniel Veditz [:dveditz] from comment #4)

Update: we later discovered that the MediaRecorder API also uses the vulnerable libvpx encoder, and we believe it could be used to trigger the vulnerability in Firefox.

In Thunderbird, it seems difficult to reach the media recording code by viewing a web page, because there is no code to grant permission to the camera (said mkmelin), so video recording might be impossible.
However, we cannot rule out than an Add-on with higher privileges might trigger media recording, so it might be best to update Thunderbird, too.

You can use MediaRecorder with any MediaStream, including HTMLCanvasElement.captureStream()

Daniel, thanks a lot for this clarification.
Then we should also do an urgent update for Thunderbird.

The ASAN log from Christian's MediaRecorder testcase (attachment 9355617 [details]) are a beautiful match for the VideoRecorder testcase ASAN log from the Chrome bug.

The crashing threads are identical below mozilla::VP8TrackEncoder::Encode and media::VpxVideoEncoder::Encode, and the allocating threads are identical below mozilla::VP8TrackEncoder::Reconfigure and media::VpxVideoEncoder::ChangeOptions

QA Whiteboard: [post-critsmash-triage]
Flags: qe-verify-
Group: core-security-release
Whiteboard: [adv-main118.0.1+][adv-esr115.3.1+]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: