Blender BKE_image_acquire_ibuf Integer Overflow Code Execution Vulnerability
A crafted .blend file can supply image dimensions that overflow the arithmetic used to size a heap buffer, so Blender allocates a buffer that is too small and then writes image data past its end. An attacker who convinces a user to open the file, or use it as a library, could achieve code execution in the context of the application.
An exploitable integer overflow exists in the Image loading functionality 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.
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 width and height values read from the file are multiplied to compute a buffer size without checking for integer overflow, producing an undersized allocation that is then written to.
Impact
A heap-based buffer overflow could allow code execution under the context of the application, though the user must open or load the crafted file.
What the attacker needed
Victim opens a crafted .blend file; or loads it as a library
The fix
The text gives no code fix; it recommends not opening .blend files, or using them as libraries, from untrusted users.
How it was found
- Generate a malicious .blend file with the supplied proof-of-concept script.
- Open the file in Blender, or add it as a library and use the Image.
- Alternatively, apply the Image to a Texture and include the texture in a Scene to trigger it without user interaction.
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.
Blender stores images inside its project files, including the width and height of generated images. When it works out how much memory to reserve, it multiplies those numbers, and a very large value can wrap around to a small one, so the program reserves too little space. It then fills that space with image data, writing past the end and corrupting memory, which can let 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.