GHSL-2024-243: Integer underflow in extract_cc_from_data leading to OOB-read in GStreamer - CVE-2024-47546
An integer underflow in the extract_cc_from_data function of GStreamer's qtdemux.c can occur when a crafted file has an atom length less than 8, causing a large length to be passed to g_memdup2. This leads to an out-of-bounds read of up to 4GB of process memory or a segmentation fault.
Originally disclosed on GitHub Security Lab
An integer underflow has been detected in extractccfromdata function within qtdemux.c.
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
The code subtracts 8 from atom_length without first checking that atom_length is at least 8, causing an integer underflow.
Impact
This vulnerability can result in reading up to 4GB of process memory or potentially causing a segmentation fault (SEGV) when accessing invalid memory.
What the attacker needed
Crafted media file
The fix
The issue was fixed and disclosed by the GStreamer project.
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 media file contains small chunks called atoms, each with a length. The code subtracts 8 from that length without checking if the length is at least 8. If the length is smaller, the result becomes a huge number, and the program tries to copy that many bytes from memory, reading far beyond what it should.
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.