Skip to content
Info disclosure Disclosed report Advanced CVE-2026-12292

Uninitialised heap disclosure via decodeAudioData when FLAC frames vary channel count

A crafted FLAC file whose frames alternate between one and two channels causes Firefox's audio decoder to allocate a two-channel output buffer but only write the first channel for mono frames, leaving the second channel uninitialised. A page could then read those uninitialised heap bytes through getChannelData, disclosing memory contents to JavaScript.

Zijie Zhao Follow

Originally disclosed on Mozilla

  • Fixed in 12 days
  • Paid in 32 days
  • Disclosed after 12 days

Created attachment 9584850 poc.html

Steps to reproduce:

  1. Serve the attached html & flac: python -m http.server -p 8991
  2. Load http://localhost:8991/poc.html in Firefox

Actual results:

getChannelData(1) on the decoded AudioBuffer returns uninitialised heap.

With an ASan build where mozjemalloc shows poisoned allocation, the page shows:

[POC] ch1[0..4095] non-zero: 4096/4096
[POC] ch1[0]=0xe4e4e4e4
ch1[1]=0xe4e4e4e4
ch1[2]=0xe4e4e4e4
ch1[3]=0xe4e4e4e4
ch1[4]=0xe4e4e4e4
...

Tested on commit 1a4668757b5f.

Expected results:

No uninitialized memory should be exposed.

Chrome and Safari both reject decoding the poc audio file:

Chrome:
ERROR: IndexSizeError: Failed to execute 'getChannelData' on 'AudioBuffer': channel index (1) exceeds number of channels (1)

// Safari
ERROR: EncodingError: Decoding failed

Analysis

poc_input.flac is a crafted FLAC stream whose STREAMINFO declares 1 channel, but whose frames alternate channel_assignment between 0 (1 channel) and 1 (2 channels).

Parser code: STREAMINFO channel count, per-frame channel assignment.

ffvpx's libavcodec/flacdec.c::decode_frame honours each frame's per-frame channel count, so the decoder emits AudioData packets with mChannels = 1, 2, 1, 2, ...

MediaDecodeTask::FinishDecode allocates a 2-channel output buffer (because mMediaInfo.mAudio.mChannels was last set to 2 by OnAudioDecodeCompleted).

The buffer uses js_pod_malloc<float> — uninitialised.

When processing mono packets, the write loop iterates for (i = 0; i < audioData->mChannels; ++i) which is only i < 1, so channel 1 in the mono-frame ranges is never written.

getChannelData(1) exposes those uninit bytes to JS by: AudioBuffer::GetChannelData -> AudioBuffer::RestoreJSChannelData.

This was found while analyzing commit 63376b3.

Please let me know if I can provide any more information, thanks!

The original report as published on Mozilla's Bugzilla, by Zijie Zhao. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 decoder sizes the output buffer from the last-seen channel count while the per-frame write loop uses each frame's own channel count, so mono frames leave the second channel of the buffer uninitialised.

Impact

A malicious page could read uninitialised heap memory from the browser process, potentially disclosing sensitive data; the report notes Chrome and Safari reject the file, so this affects Firefox only.

What the attacker needed

Victim visits a malicious page; Firefox browser; crafted FLAC file served by attacker

How it was found

  1. Serve the proof-of-concept HTML page and crafted FLAC file over a local HTTP server.
  2. Load the page in Firefox.
  3. The page decodes the audio and reads channel 1 of the resulting buffer, showing non-zero uninitialised bytes.

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.

When a browser decodes an audio file it reserves memory for the sound samples. Here the file tricks the decoder into reserving space for two channels but only filling in one, so the other half of the memory is never written and still holds whatever was there before. A web page can then read that leftover memory, which may contain data from other parts of the browser.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Zijie Zhao

View all

2 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.