Skip to content
Memory corruption Advisory Advanced CVE-2024-41147

miniaudio ma_dr_flac__decode_samples__lpc out-of-bounds write vulnerability

A missing allocation-size check in the FLAC LPC decoding function allows a crafted FLAC file to write past the end of a heap buffer, corrupting adjacent heap metadata. An attacker can supply a malicious file to cause memory corruption and a crash during playback.

A member Follow

Originally disclosed on Cisco Talos

High 7.7 View original

An out-of-bounds write vulnerability exists in the madrflacdecodesampleslpc functionality of Miniaudio miniaudio v0.11.21. A specially crafted .flac file can lead to memory corruption.

a member, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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 decoder does not verify that the allocated sample buffer is large enough for the LPC order and block size before writing decoded samples.

What the attacker needed

Victim opens a malicious FLAC file

How it was found

  1. Open a crafted FLAC file with the miniaudio playback example.
  2. The decoder processes the malformed FLAC frame and reaches the LPC decoding function.
  3. The LPC decoding loop writes samples past the allocated buffer, overwriting heap metadata.
  4. The program later frees the corrupted heap chunk and aborts with an invalid pointer error.

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.

A FLAC file is a type of audio file. The library reads the file and writes decoded audio samples into a memory buffer. Because it does not check that the buffer is large enough, a malformed file can make it write past the end of the buffer, damaging other data in memory and causing the program to crash.

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 A member

View all

110 more disclosed reports, best first.

More from Cisco Talos

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.