Skip to content
Memory corruption Advisory Advanced CVE-2017-2907

Blender Sequencer avi_format_convert Integer Overflow Code Execution Vulnerability

Blender's AVI frame decoding multiplies the video width and height from the file header without checking for overflow, so a crafted .avi file can cause an undersized heap buffer to be allocated. When the frame data is copied into that buffer, a heap-based buffer overflow occurs, which can lead to code execution in the context of the application.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable integer overflow exists in the animation playing functionality of the Blender open-source 3d creation suite version 2.78c. A specially created .avi file can cause an integer overflow resulting in a buffer overflow which can allow for code execution under the context of the application.

a member, on Cisco Talos

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 product of the AVI header Width and Height fields (times 3) is computed without an overflow check, so the allocation size wraps to a small value while the copy loops still use the original dimensions.

Impact

A crafted .avi file could cause a heap-based buffer overflow leading to code execution under the context of the application, though the user must open or use the file.

What the attacker needed

Victim opens a crafted .avi file; no account needed

The fix

The allocation size calculation should be checked for integer overflow before allocating, and untrusted animation files should not be used as assets.

How it was found

  1. Create a crafted .avi file with the provided generator script.
  2. Open the file in Blender, either as an asset or by passing it as a command-line argument.
  3. Blender reads the AVI header and stores the width and height values.
  4. A buffer is allocated using the overflowing width times height times 3 calculation.
  5. The frame data is decoded into the undersized buffer, causing a heap overflow.

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 video file stores its frame size as two numbers, width and height. Blender multiplies them to work out how much memory to reserve, but with huge values the multiplication wraps around to a small number, so too little memory is reserved. The file's pixel data is then copied into that small space, spilling over into neighbouring memory, which an attacker can use to run their own code.

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 A member

View all

110 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

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.