Blender Sequencer imb_get_anim_type Streams Integer Overflow Code Execution Vulnerability
Blender's AVI header parser multiplies the stream count by the size of a stream record without checking for integer overflow, so a crafted .avi file can cause an undersized heap allocation. The subsequent loop then writes past the buffer, which the advisory says can allow code execution in the context of the application.
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.
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 stream count read from the file is multiplied by the record size without an overflow check, so the allocation size wraps to a small value while the read loop still uses the original count.
Impact
A crafted .avi file could cause a heap-based buffer overflow that may allow code execution under the context of the application, though the user must open the file.
What the attacker needed
Victim opens a crafted .avi file; no account needed
The fix
The multiplication of the stream count by the record size should be checked for overflow before allocating, and the advisory recommends not using untrusted animation files as assets.
How it was found
- Create a crafted .avi file with the provided generator script.
- Open the file in Blender as an asset, or pass it to the executable with the -a option.
- Blender parses the AVI header and reads the stream count field.
- The stream count is multiplied by the record size and wraps, producing an undersized allocation.
- The loop reading stream records writes past the end of the 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.
When Blender opens a video file it reads a number from the file saying how many audio/video tracks it contains, then reserves memory for that many track records. If the number is huge, the multiplication used to work out the memory size wraps around to a small value, so Blender reserves too little space. It then copies the track data into that small space, overwriting neighbouring memory, which can crash Blender or 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.