Skip to content
Memory corruption Advisory Advanced CVE-2023-47212

stb stb_vorbis.c comment heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in stb_vorbis.c v1.22 when parsing comment lists in Ogg Vorbis files. An attacker can provide a malicious .ogg file to trigger an out-of-bounds write, potentially leading to arbitrary code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A heap-based buffer overflow vulnerability exists in the comment functionality of stb vorbis.c v1.22. A specially crafted .ogg file can lead to an out-of-bounds write.

Francesco Benvenuto, 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 an integer overflow in the calculation of the size for the comment pointer array, leading to under-allocation and subsequent out-of-bounds write.

Impact

An attacker could achieve arbitrary code execution with enough heap grooming.

What the attacker needed

Malicious .ogg file; victim opens file with vulnerable library

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 is a bug in a library that reads audio files. When the library reads a list of comments from a file, it calculates how much memory to reserve. If the file claims there are a huge number of comments, that calculation can wrap around and reserve too little memory. Then the library writes more pointers than fit, corrupting memory. An attacker can craft a file to exploit this and possibly run their own code.

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 Francesco Benvenuto

View all

152 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.