Last week the @FFmpeg account began taunting security researchers. Foolish thing to do, as it ignores the asymmetry of their attack surface vs ours.
So as an exercise I found a stack-based buffer overflow on software that he wrote. Took me ~20 mins to find it. Thread 🧵(1/5)
First, I noticed the FFMpeg account is not controlled by an active developer of FFMpeg, but apparently by several guys, one of them named Keiran. Weird, but it is not important.
The keirank github user has very few commits, and none on FFMPEG, but Upipe, a video processing software from his company.
So lets check his most recent commit "Validate num_delta_pocs to avoid a stack smash". (2/5)
@FFmpeg Indeed @FFmpeg wrote a validation, but it only checks one index despite working with two-dimensional arrays of varying dimensions.
This cannot be right. Since I didn't have time to verify it , I instructed a LLM to "Find critical bugs on the code"
GLM 4.6 found many (3/5)
Each time a predictor frame is calculated, it increases the reference pic array, but this is not taken into account in the validations.
Overflow (overread).
So we have a way to over-read up to 64 bytes from the stack (64 being the max amount of reference frames).
But can we write in the stack? I ask the LLM to write a h265 framer fuzzer, it's very complex, nevertheless, it does it in one-shot (4/5)
@FFmpeg So now we have read/write stack-based buffer overflow. Game over.
Fuzzer and complete explanation can be found on my github:
This is the complete DNA of the Coronavirus (SARS-CoV-2). We are being attacked by a 8 kilobytes virus. Remember this when you hate on computers security. (source: ncbi.nlm.nih.gov/nuccore/MN9089… )
It has remote exploitation, persistence, AV evasion and works on multiple incompatible platforms (bats, humans, dogs, etc) all in 7.25 KB. Ah but I'm sure you write very tight shellcodes.
People are asking for a download link so here is this Pastebin of the Covid19 RNA that I found online: pastebin.com/VZ6BfvuK