Blender Sequencer imb_load_dpx_cineon Integer Overflow Code Execution Vulnerability
A crafted DPX/Cineon image file causes an integer overflow when Blender calculates the buffer size for image data, leading to an undersized heap allocation. When the image is decoded into that buffer, a heap-based buffer overflow occurs, which can allow code execution in the context of the application.
An exploitable integer overflow exists in the DPX loading functionality of the Blender open-source 3d creation suite version 2.78c. A specially crafted .cin 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
Likely the product of width, height and four bytes per pixel is computed without checking for 32-bit integer overflow, so the resulting size is used for an undersized allocation.
Impact
A heap-based buffer overflow could allow code execution under the context of the application, though the user must open the crafted file.
What the attacker needed
Victim opens a crafted .cin file; file loaded via sequencer or CLI
The fix
The allocation size calculation should be checked for integer overflow before the buffer is allocated, and untrusted image files should not be loaded in the sequencer until then.
How it was found
- Create a malicious .cin file using the supplied generator script.
- Open the file in Blender, either by adding it as an asset in the sequencer or by passing it as a command-line argument.
- Blender reads the header, computes an overflowing buffer size and allocates too little memory.
- Blender decodes the image data 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.
Blender can open image files, and for one format it works out how much memory to reserve by multiplying the image width, height and colour depth. If those numbers are large enough, the multiplication wraps around to a small number, so too little memory is reserved. Blender then writes the real image data into that small space, overwriting nearby 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.