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

Blender BKE_mesh_calc_normals_tessface Integer Overflow Code Execution Vulnerability

An integer overflow in Blender's mesh normal calculation for older .blend files can cause an undersized heap buffer, leading to a buffer overflow when normals are written. An attacker could convince a user to open a malicious .blend file, potentially achieving code execution.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable integer overflow exists in the BKEmeshcalcnormalstessface functionality of the Blender open-source 3d creation suite. 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.

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 vertex or face count and the size of a normal vector is computed in 32-bit arithmetic without overflow checking, so a large count wraps to a small value and the subsequent allocation is undersized.

Impact

This could allow code execution under the context of the application, though the user must open a malicious file.

What the attacker needed

Victim opens a malicious .blend file

The fix

The report recommends not using untrusted Blender files; it does not state that a code fix was released.

How it was found

  1. Create a .blend file with a mesh whose vertex or face count is large enough to overflow the size calculation.
  2. Open the crafted .blend file in Blender, or pass it as a command-line argument.
  3. Blender loads the file and calls the version-upgrade routine for old files.
  4. The routine calls the normal calculation function with the oversized counts.
  5. The undersized buffer is allocated and then written past its bounds, causing a crash or memory corruption.

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 loads an old file, it calculates how much memory to reserve for storing mesh data. If the numbers in the file are huge, the multiplication used to compute the size can wrap around to a small number, so too little memory is reserved. Later, writing the calculated normals goes past the end of that small buffer, corrupting memory and possibly 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 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.