Skip to content
Memory corruption Write-up Advanced

[0day] [PoC] Incorrect fix for gstreamer FLIC decoder vulnerability CESA-2016-0004

The patch for the gstreamer FLIC decoder checked each skip/count pair against the line width separately instead of cumulatively, so a crafted FLIC file could still write past the end of the canvas buffer. An attacker could use this to corrupt heap memory, as shown by a crash in the debugger.

Chris Evans Follow

Published on scarybeastsecurity.blogspot.com

The original lives on scarybeastsecurity.blogspot.com

We do not hold its text, 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 write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

The out-of-bounds write corrupts heap metadata and crashes the decoder; the author says it offers similar power to the original bug but with less range into the heap, and would be foolish to call non-exploitable.

What the attacker needed

Victim opens a crafted FLIC file; gstreamer FLIC decoder in use

The fix

The bounds check should track the cumulative offset along the line, not just each skip/count pair, so the total write stays within the canvas width.

How it was found

  1. Create a FLIC file with a canvas of width 255 and height 1.
  2. Include a line chunk that starts at line 0 and covers 1 line, with 2 skip/count pairs.
  3. Make the first pair skip 255 pixels and write 0 pixels, which passes the check.
  4. Make the second pair skip 0 and write 128 pixels, which also passes the check on its own.
  5. Open the file with the gstreamer player and observe the out-of-bounds write and crash.

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 write-up has not been written yet. The Original tab links to the source.

A video decoder reads a file that describes how to draw lines of pixels. The fix tried to stop drawing past the edge of a line, but it checked each drawing instruction on its own rather than adding them up. So a file with several instructions could still draw past the end of the buffer and overwrite nearby 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.

More by Chris Evans

View all

11 more disclosed reports, best first.

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.