GHSL-2024-280: Use-After-Free read in Matroska CodecPrivate in GStreamer - CVE-2024-47834
A use-after-free read occurs when processing Matroska CodecPrivate elements: memory is freed but later accessed during caps serialization. An attacker could trigger an out-of-bounds read and memory leak by supplying a crafted Matroska file.
Originally disclosed on GitHub Security Lab
An Use-After-Free read vulnerability has been discovered affecting the processing of CodecPrivate elements in Matroska streams.
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
Impact
This vulnerability can lead to an out-of-bounds read and a memory leak, but it does not cause a crash and requires AddressSanitizer to detect.
What the attacker needed
Crafted Matroska file; run with AddressSanitizer to detect
The fix
The issue was fixed and disclosed by the GStreamer project.
How it was found
- Run the gst-discoverer-1.0 tool on the provided Matroska file.
- The tool processes the CodecPrivate element, allocating memory.
- The memory is freed by gst_matroska_track_free.
- Later, caps serialization accesses the freed memory, causing a use-after-free 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.
A use-after-free happens when a program frees some memory but then keeps using it, like reading a note after throwing it away. Here, a malformed video file causes the program to read freed memory, which can leak information. The bug only shows up with special debugging tools and does not crash the program.
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.