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

Heap buffer overflow in WebAudio (CVE-2026-5864)

A SIMD loop in WebAudio's NaN-handling routine advanced in steps of four floats but was bounded only by the span length, so a render quantum that is not a multiple of four caused the final iteration to read and write past the AudioParam buffer. Once script could choose an odd render quantum such as 133, this produced an out-of-bounds heap access and a crash.

Syn4pse Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 31 days

Summary

AudioParamHandler::CalculateFinalValues forwards a render-quantum-sized span into HandleNaNValues, but HandleNaNValues processes the span in 4-float SIMD chunks using k < values.size() instead of truncating to a multiple of 4. Once WebAudioConfigurableRenderQuantummakes odd render quanta such as133script-reachable, the last SIMD iteration reads and writes beyond theAudioParam` buffer and produces OOB.

NOTE: this issue's root cause is difference with the previous reported issues 487357842, 487357842

Details

The current WebAudio implementation allows script to choose a non-default render quantum through BaseAudioContext.renderQuantumSize and validates that value in AudioContext::Create. That value flows into audio-rate AudioParam processing, where AudioParamHandler::CalculateFinalValues calls `HandleNaNValues(values, DefaultValue()) on a span whose length is the active render quantum.

In HandleNaNValues, the issue is that the SIMD loop advances by four but is bounded only by k < values.size(). For a 133-frame quantum, the final iteration executes with k == 132, so the _mm_loadu_ps/_mm_storeu_pspair touches elements132..135even though only element132is inside the span. After that,values.subspan(k) is evaluated with k == 136, which is also beyond the span length:

C++
void HandleNaNValues(base::span<float> values, float default_value) {
  unsigned k = 0;
#if defined(ARCH_CPU_X86_FAMILY)
  if (values.size() >= 4) {
    __m128 defaults = _mm_set1_ps(default_value);
    for (k = 0; k < values.size(); k += 4) {
      __m128 v = _mm_loadu_ps(values.data() + k);
      __m128 isnan = _mm_cmpunord_ps(v, v);
      __m128 result = _mm_and_ps(isnan, defaults);
      result = _mm_or_ps(_mm_andnot_ps(isnan, v), result);
      _mm_storeu_ps(values.data() + k, result);
    }
  }
#endif
  std::ranges::replace_if(values.subspan(k),
                          [](float value) { return std::isnan(value); },
                          default_value);
}

Bisection

This issue is introduced by the commit https://chromium-review.googlesource.com/c/chromium/src/+/6804197, which makes this issue became script-reachable when renderSizeHint is propagated into the CalculateFinalValues and HandleNaNValues.

Reproduction

Download the chromium from https://storage.googleapis.com/chromium-browser-asan/linux-release/asan-linux-release-1595156.zip

Run with

./chrome --no-sandbox --enable-experimental-web-platform-features poc.html

You would observe the OOB crash shown in asan.txt

Suggested Fix

Clamp HandleNaNValues to a SIMD-safe prefix before issuing 4-wide loads and stores. We may compute simd_end = values.size() & ~3u, iterate while k < simd_end, and keep the scalar tail in the `replace_if(values.subspan(k), ...) path.

The original report as published on the Chromium issue tracker, by Syn4pse. 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

The SIMD loop in HandleNaNValues stepped by four but was bounded by the full span size instead of a size rounded down to a multiple of four, so the trailing partial chunk was over-read and over-written.

Impact

A page could trigger an out-of-bounds heap read and write in the renderer, causing a crash and potentially memory corruption; the report demonstrates the crash under ASan.

What the attacker needed

Experimental web platform features enabled; script sets a non-default render quantum

The fix

The suggested fix clamps the SIMD loop to a size rounded down to a multiple of four and leaves the remaining elements to the scalar path.

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.

Audio code processes samples in small batches, and some of it uses special CPU instructions that handle four numbers at once. The loop assumed the batch size was always a multiple of four, so when a page asked for a batch of 133 samples the last group of four reached past the end of the memory buffer. That out-of-bounds access can crash the browser and, in principle, corrupt memory.

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 by Syn4pse

View all

13 more disclosed reports, best first.

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.