mackron dr_libs dr_mp3 drmp3_init_internal out-of-bounds read vulnerability
A truncated MP3 frame causes the side-information bit reader to advance past the end of the heap-allocated frame buffer, so the decoder reads the Xing/Info tag identifier from memory beyond the allocation. An attacker can supply a crafted .mp3 file to trigger an out-of-bounds read, which the report rates as limited confidentiality impact.
Originally disclosed on Cisco Talos
A out-of-bounds read vulnerability exists in the drmp3 drmp3initinternal functionality of drlibs (version(s): 0.7.3). A specially crafted .mp3 file can lead to an out-of-bounds read.
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 byte offset derived from the side-information bit position is added to the frame base without checking that the resulting pointer, plus the 4-byte tag identifier, still lies inside the allocated frame buffer.
Impact
The out-of-bounds read could disclose a small amount of adjacent heap memory or crash the application, and the report's CVSS vector rates confidentiality as low with no integrity or availability impact.
What the attacker needed
Victim opens a crafted .mp3 file; application uses dr_mp3 0.7.3
How it was found
- Craft an MP3 containing a truncated MPEG 2.5 Layer III frame that is too short to hold both the side information and the 4-byte tag identifier.
- Pass the file to the decoder through the memory initialisation entry point.
- The side-information parser advances its bit position beyond the frame size, so the computed tag pointer lands past the allocation.
- The decoder reads the first byte of the tag identifier at that out-of-range address, which AddressSanitizer reports as a heap-buffer-overflow read.
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.
An MP3 file is made of frames, and the decoder first reads a small header plus some extra data called side information to find where the audio starts. In this library, the code that reads that extra data can move its position past the end of the buffer holding the frame, and the decoder then looks for a tag marker at that out-of-range spot. Reading memory outside a buffer is a bug because the program may see data it should never touch, and in the worst case it can 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.