GHSL-2024-228: OOB-write in subparse/gstssaparse.c in GStreamer - CVE-2024-47541
An out-of-bounds write occurs in GStreamer's SSA subtitle parser when a closing curly bracket appears before an opening one, causing memmove to duplicate a substring and grow the write size each loop. An attacker could crash the process or corrupt heap memory by supplying a crafted subtitle file.
Originally disclosed on GitHub Security Lab
An OOB-write vulnerability has been identified in the gstssaparseremoveoverridecodes function of the gstssaparse.c file.
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 parser assumes a closing brace always follows an opening brace and uses memmove with a length based on the remaining string without checking that the destination has enough space, so a closing brace before an opening brace causes repeated, growing copies.
Impact
The overwrite can corrupt the entire process memory, leading to a segmentation fault and heap errors such as invalid pointer or corrupted top size.
What the attacker needed
Crafted SSA subtitle input
The fix
It 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 subtitle parser looks for curly-bracket codes that style text. If a closing bracket comes before an opening one, the code copies part of the text to the wrong place and keeps copying more each time, writing past the end of the memory buffer. This can crash the program or corrupt memory.
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.