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

Blender customData_add_layer__internal Integer Overflow Code Execution Vulnerability

An integer overflow in Blender's handling of legacy .blend files can cause a buffer overflow when converting old mesh data, allowing an attacker to execute code by convincing a user to open a malicious file.

Cory Duplantis Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable integer overflow exists in the upgrade of the legacy Mesh attribute tface of the Blender open-source 3d creation suite v2.78c. A specially crafted .blend file can cause an integer overflow resulting in a buffer overflow which can allow for code execution under the context of the application.

Cory Duplantis and 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

Likely the multiplication of the total element count by the structure size is performed without checking for integer overflow, leading to an undersized allocation.

Impact

This could allow an attacker to execute code under the context of the application, but requires the user to open a malicious file.

What the attacker needed

Victim opens a malicious .blend file

How it was found

  1. Create a .blend file with a Mesh object that has a large totface value and the deprecated tface field set.
  2. Open the crafted .blend file in Blender.
  3. Blender's version check triggers customdata_version_242, which calls CustomData_add_layer with the large totface value.
  4. The size calculation overflows, causing a small allocation.
  5. The subsequent loop copies tface data into the undersized buffers, overflowing the heap.

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.

When Blender opens an old file, it converts some outdated data to a new format. The program calculates how much memory to reserve by multiplying a number from the file by a fixed size, but a very large number can wrap around to a small value. This means it reserves too little memory and then writes more data than fits, corrupting memory and potentially letting an attacker 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 Cory Duplantis

View all

1 more disclosed report, 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.