CVE-2025-32025:
bep/imagemeta allows a potentially large memory allocation in PNG and WebP parsing
6.9
CVSS ScoreBasic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/bep/imagemeta | go | < 0.11.0 | 0.11.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability description states that the buffer created for parsing metadata was unbounded, leading to potential large memory allocation. The provided commit ee0de9b029f4e82106729f69559f27c9a404229d
directly addresses this. The changes in io.go
introduce a maxBufSize
constant (10MB) and modify the bufferedReader
function. Specifically, the bufferedReader
function, which is a method of streamReader
, now checks if the requested length
for the buffer exceeds maxBufSize
. If it does, an error is returned, preventing the large allocation. Therefore, (*streamReader).bufferedReader
was the function where the unbounded allocation could occur, making it the vulnerable function. The changes in imagemeta.go
are related to error propagation from a goroutine and do not directly involve the memory allocation logic itself, though they are part of the same commit. The changes in imagemeta_test.go
are for testing purposes.