Skip to content
Memory corruption Write-up Advanced

[0day] [exploit] Advancing exploitation: a scriptless 0day exploit against Linux desktops

A heap corruption vulnerability in the gstreamer FLIC decoder lacks bounds checking, allowing an attacker to write out of bounds on the heap. The author developed a scriptless exploit that achieves code execution on Fedora 24 by corrupting decoder state and function pointers, despite ASLR and DEP protections.

Chris Evans Follow

Published on scarybeastsecurity.blogspot.com

A powerful heap corruption vulnerability exists in the gstreamer decoder for the FLIC file format. Presented here is an 0day exploit for this vulnerability.

Chris Evans, on scarybeastsecurity.blogspot.com

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

How it worked

Impact

An attacker could achieve code execution on a Linux desktop by tricking a user into opening a malicious FLIC file, potentially leading to a drive-by download when combined with other vulnerabilities.

What the attacker needed

Victim opens a malicious FLIC file; gstreamer FLIC decoder installed; target runs Fedora 24 with specific gstreamer version

How it was found

  1. Craft a FLIC file with a FLX_LC command that sets a start_line value greater than the canvas height, causing an out-of-bounds write.
  2. Use the out-of-bounds write to corrupt the flxdec->converter pointer, then use FLX_COLOR256 commands to perform partial pointer overwrites and gain an absolute write primitive.
  3. Corrupt a function pointer (gst_list_iterator_resync) with a single-byte overwrite to point to a gadget that returns 0, forcing the decoder loop to continue.
  4. Use the copy primitive (corrupting delta_data and frame_data) to copy pointers into the input file buffer and then use them to corrupt a GstPad object.
  5. Corrupt the GstPad object's chainfunc, peer, and parent pointers to make gst_pad_push return GST_FLOW_OK, allowing further frames to be processed.
  6. Leverage the addition primitive (frame_time and next_time) to build a ROP chain and achieve code execution.

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.

The FLIC video decoder in gstreamer does not check that the data it reads stays within the memory buffer it was given. An attacker can craft a malicious FLIC file that causes the decoder to write past the end of that buffer, corrupting other memory. This can lead to running arbitrary code on the victim's machine when the file is opened.

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.