Nothings stb_image Heap-Based Buffer Overflow Vulnerability in Multi-Frame GIF Handler

Vulnerability

A heap-based buffer overflow vulnerability has been identified in Nothings stb_image versions through 2.30. The issue arises in the function 'stbi__gif_load_next' within 'stb_image.h', specifically in the Multi-frame GIF File Handler component. The vulnerability is triggered by a crafted multi-frame GIF file, which exploits an incorrectly calculated pointer, leading to an out-of-bounds memory read. This manipulation causes a heap-buffer-overflow condition, with potential impacts including information disclosure through a heap memory leak and a denial-of-service by causing a crash.

Impact

Exploitation of this vulnerability leads to a heap-based buffer overflow, causing an out-of-bounds memory read. This type of memory corruption can often be exploited to execute arbitrary code or cause a program to crash.

Reproduction

The vulnerability can be reproduced by compiling a C program with AddressSanitizer enabled, which will detect the heap-buffer-overflow. The compiled program can then be run with a crafted GIF file that triggers the vulnerability. The AddressSanitizer will report the heap-buffer-overflow error, indicating that the vulnerability has been successfully exploited.

Added: Mar 31, 2026, 7:23 AM
Updated: Mar 31, 2026, 7:23 AM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
3.1
exploitability
5.8
remediation
0.0
relevance
5.0
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.