Closed Bug 2027499 (CVE-2026-6752) Opened 7 months ago Closed 7 months ago

Heap buffer overflow in RtpPacket::SetCsrcs — missing upstream security fix

Categories

(Core :: WebRTC, defect)

defect

Tracking

()

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

People

(Reporter: jmwebdevelopement, Assigned: mjf)

References

(Regression)

Details

(4 keywords, Whiteboard: [adv-main150+][adv-esr115.35+][adv-esr140.10+])

Attachments

(4 external files, 1 obsolete file)

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:

Manual source code review of third_party/libwebrtc/modules/rtp_rtcp/source/rtp_packet.cc identified that RtpPacket::SetCsrcs() (lines 227-241) performs heap buffer writes with only RTC_DCHECK bounds checking — compiled out in release builds. Firefox's libwebrtc was last synced 2026-03-24, missing upstream Chromium security fix commit 5560f13 (chromium:486317116) authored 2026-03-25.

Actual results:

SetCsrcs() writes attacker-controlled uint32_t CSRC values past the heap buffer boundary via WriteAt() BEFORE SetSize() resizes the buffer. All 5 guard conditions are RTC_DCHECK (no-ops in release Firefox). A malicious WebRTC peer can deliver crafted RTP packets with >15 CSRCs, causing heap buffer overflow with attacker-controlled content. Adjacent heap objects include SRTP contexts and audio frame buffers.

Expected results:

SetCsrcs() should perform runtime bounds checking (RTC_CHECK, not RTC_DCHECK) and resize the buffer BEFORE writing. The upstream fix (commit 5560f13) adds runtime truncation and resize-before-write ordering. Firefox should import this fix.

Group: core-security → media-core-security

We have a consistent record of updating this library:
https://bugzilla.mozilla.org/buglist.cgi?v1=update%20libwebrtc%20to%20&o1=substring&f1=short_desc

This is not included on Chrome's "security notify" list yet which means it could in theory change or require follow-up fixes before they release it.
https://webrtc-review.googlesource.com/c/src/+/459943

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mfroman)
Keywords: sec-high

I don't know if this vulnerability can be triggered in Firefox, or how serious a security vulnerability this is for Chrome, but it is an inaccessible Chrome bug and does presumably affect Firefox since we have coverage data for this file. Guessing "sec-high" because it's a bounds issue

Attached file (secure) (obsolete) —
Assignee: nobody → mfroman
Status: NEW → ASSIGNED
Flags: needinfo?(mfroman)
Attachment #9560835 - Attachment is obsolete: true

Byron,

This may have to wait until Wed - it appears to require taking parts of the following upstream commits:
5560f130af Truncate CSRC list in RtpPacket::SetCsrcs if too large
359fa9ef4f Replace ArrayView with std::span in modules/rtp_rtcp
b4ba35203b Restrict ArrayView constructor from genertic range
c445a96208 Deprecate conversion from nullptr to an empty ArrayView

Taking just 5560f130af does not compile. I might get a chance to look combining what we need into a single commit.

Flags: needinfo?(docfaraday)

I'm working this patch set now.

Flags: needinfo?(docfaraday)
Attached file (secure) —

This was easier than the patch-stack made it look - it only required a small change on top of the upstream commit 5560f130af.

Comment on attachment 9563358 [details]
(secure)

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: If someone is really paying close attention they might figure out that they could create a malicious peer.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
  • Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: all
  • If not all supported branches, which bug introduced the flaw?: Bug 1341285
  • Do you have backports for the affected branches?: No
  • If not, how different, hard to create, and risky will they be?: Not difficult.
  • How likely is this patch to cause regressions; how much testing does it need?: Not likely.
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: Yes
Attachment #9563358 - Flags: sec-approval?

Comment on attachment 9563358 [details]
(secure)

Approved to land and request uplift

Attachment #9563358 - Flags: sec-approval? → sec-approval+
Group: media-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Keywords: regression
Regressed by: 1341285
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch

The patch landed in nightly and beta is affected.
:mjf, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(mfroman)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: A malicious WebRTC peer could deliver crafted RTP packets with >15 CSRCs, causing heap buffer overflow with attacker-controlled content. Adjacent heap objects include SRTP contexts and audio frame buffers.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is a small change in code that has been static since 2017.
  • String changes made/needed?: n/a
  • Is Android affected?: yes
Attachment #9567068 - Flags: approval-mozilla-beta?
Attached file (secure) —
Attached file (secure) —
Attachment #9567224 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: A malicious WebRTC peer could deliver crafted RTP packets with >15 CSRCs, causing heap buffer overflow with attacker-controlled content. Adjacent heap objects include SRTP contexts and audio frame buffers.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is a small change in code that has been static since 2017.
  • String changes made/needed?: n/a
  • Is Android affected?: yes
Attached file (secure) —
Attachment #9567225 - Flags: approval-mozilla-esr115?

firefox-esr115 Uplift Approval Request

  • User impact if declined/Reason for urgency: A malicious WebRTC peer could deliver crafted RTP packets with >15 CSRCs, causing heap buffer overflow with attacker-controlled content. Adjacent heap objects include SRTP contexts and audio frame buffers.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is a small change in code that has been static since 2017.
  • String changes made/needed?: n/a
  • Is Android affected?: yes
Attachment #9567068 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: needinfo?(mfroman)
Attachment #9567224 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9567225 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
QA Whiteboard: [sec] [uplift] [qa-triage-done-c151/b150]
Whiteboard: [adv-main150+]
Whiteboard: [adv-main150+] → [adv-main150+][adv-esr115.35+]
Whiteboard: [adv-main150+][adv-esr115.35+] → [adv-main150+][adv-esr115.35+][adv-esr140.10+]
Flags: sec-bounty?
Flags: sec-bounty? → sec-bounty+
Alias: CVE-2026-6752
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: