Skip to content
Memory corruption Advisory Advanced CVE-2026-9119

Heap buffer overflow in WebRTC (CVE-2026-9119)

A heap buffer overflow in WebRTC's NetEq module occurs when transitioning from Comfort Noise to normal speech on multi-channel streams, due to a logical flaw in index wrapping and unhandled CNG errors. An attacker could potentially achieve remote code execution in the renderer process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 33 days

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A potential heap buffer overflow occurs in WebRTC's NetEq module during a transition from Comfort Noise (CNG) to normal speech on multi-channel streams. A logical flaw in index wrapping combined with unhandled CNG errors leads to out-of-bounds access, potentially allowing RCE in the renderer process.

Affected files:

  • third_party/webrtc/modules/audio_coding/neteq/normal.cc
  • third_party/webrtc/modules/audio_coding/neteq/neteq_impl.cc
  • third_party/webrtc/modules/audio_coding/neteq/audio_vector.h

Estimated timestamp from git blame: 2022-01-24

Technical Analysis

A potential heap-buffer-overflow (read-modify-write) exists in webrtc::Normal::Process due to a failure to correctly manage buffer sizes and index wrapping when handling multi-channel audio streams during a transition from Comfort Noise (CNG) back to normal speech.

The Vulnerability

The issue is triggered when a WebRTC session alternates between multi-channel L16 audio and CNG. The steps below outline a potential path an attacker could use to reach the vulnerability:

  1. Initialization: An attacker establishes a WebRTC connection negotiating a multi-channel L16 audio stream (e.g., 48 kHz, 8 channels) and CNG. When the first packet arrives, NetEqImpl::SetSampleRateAndChannels allocates an algorithm_buffer_ containing an AudioVector for each channel. Each AudioVector is initialized with a default capacity of 11 elements (int16_t).

  2. State Desynchronization: The attacker sends a CNG SID packet. NetEqImpl::DoRfc3389Cng calls comfort_noise_->Generate, which logs an error and returns kMultiChannelNotSupported because CNG is only supported for mono streams. However, DoRfc3389Cng unconditionally updates the last_mode_ to kRfc3389Cng and ignores the kMultiChannelNotSupported error. The buffer remains empty with a capacity of 11.

  3. Transition to Normal Speech: The attacker sends a very small multi-channel L16 packet (e.g., 10 samples per channel). NetEqImpl::DoNormal is called. The 10 samples are pushed into the algorithm_buffer_, and since 10 fits within the default capacity of 11, no reallocation occurs.

  4. Out-of-Bounds Access: Normal::Process executes a cross-fade loop to transition from CNG to the new speech frame because last_mode_ == kRfc3389Cng:

    C++
    // third_party/webrtc/modules/audio_coding/neteq/normal.cc
    for (size_t i = 0; i < win_length; i++) {
      win_up_Q14 += win_slope_Q14;
      (*output)[0][i] = (win_up_Q14 * (*output)[0][i] + ... ) >> 14;
    }
    

    At 48 kHz, win_length is 48. The code accesses the array up to i = 47.

  5. Insufficient Wrapping: The AudioVector indexing logic uses an inline WrapIndex method which performs a single subtraction instead of a modulo operation:

    C++
    // third_party/webrtc/modules/audio_coding/neteq/audio_vector.h
    inline size_t WrapIndex(size_t index, size_t begin_index, size_t capacity) {
      size_t ix = index + begin_index;
      if (ix >= capacity) {
        ix -= capacity;
      }
      return ix;
    }
    

    For i = 47 and capacity = 11, ix becomes 36, which is significantly out-of-bounds for the 11-element array. In release builds where RTC_DCHECK_EQ(output->Channels(), 1) is compiled out, this leads to an out-of-bounds read-modify-write.

Impact

The overflow occurs in small PartitionAlloc buckets (e.g., 32-byte bucket). Due to how AudioMultiVector allocates its channels, the overflow is likely to corrupt adjacent AudioVector structures or their array_ pointers. By overwriting an AudioVector pointer, an attacker could achieve an arbitrary read/write primitive during subsequent audio processing, potentially leading to arbitrary remote code execution within the sandboxed renderer process.

(Note: These are potential exploit steps based on static analysis; our tooling agent does not yet have the ability to run code to produce a working proof of concept.)

Suggested Fix

  1. State Consistency: In NetEqImpl::DoRfc3389Cng, handle ComfortNoise::kMultiChannelNotSupported properly and prevent updating last_mode_ to kRfc3389Cng if CNG generation fails.
  2. Index Wrapping: Update AudioVector::WrapIndex to use modulo (ix %= capacity) instead of a single subtraction, or enforce tighter checks if indices are never expected to exceed 2 * capacity.

Evaluated with Chrome root at commit: c0eb5541aebfa4ea08806eaf6e94bcc69f87ab2f


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the combination of an unchecked error when generating comfort noise for multi-channel streams and an index-wrapping function that uses a single subtraction instead of a modulo, allowing out-of-bounds access.

Impact

The overflow could corrupt adjacent AudioVector structures, potentially leading to an arbitrary read/write primitive and remote code execution within the sandboxed renderer process.

What the attacker needed

WebRTC connection with multi-channel L16 and CNG; Ability to send crafted RTP packets

The fix

The fix should handle the kMultiChannelNotSupported error properly and prevent updating last_mode_ to kRfc3389Cng if CNG generation fails, and update AudioVector::WrapIndex to use modulo instead of a single subtraction.

How it was found

  1. Establish a WebRTC connection negotiating a multi-channel L16 audio stream and CNG.
  2. Send a CNG SID packet, which causes comfort noise generation to fail but still updates the last mode.
  3. Send a very small multi-channel L16 packet that fits in the default buffer capacity without reallocation.
  4. Trigger the cross-fade loop in Normal::Process, which accesses the buffer out of bounds due to insufficient index wrapping.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This report describes a memory safety bug in WebRTC, the technology that handles real-time audio and video in browsers. When a call switches from background noise to speech, the code that manages audio buffers can write past the end of an array, which could let an attacker run their own code on your computer. The bug is in a part called NetEq that smooths out audio playback.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.