Heap Buffer Overflow Vulnerability in libvips
Summary
OSV-2025-6: Heap-buffer-overflow in next_marker. Affects libvips versions >= 7b47b07bcd0583c4f9d4afaac85d3abb5008edff, < 4689cda680c2b59bf8dca0b856fb58087196f60a. Fixed in 4689cda680c2b59bf8dca0b856fb58087196f60a. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
libvips is an open-source image processing library that is designed for high performance and low memory usage. It is widely used for processing large images and supports various image formats. However, like many libraries, it can be susceptible to vulnerabilities that may compromise its functionality and security. The specific vulnerability in question is a heap buffer overflow, which can lead to unexpected behavior or crashes in applications that utilize this library.
Vulnerability Detail
The vulnerability identified as OSV-2025-6 is a heap buffer overflow occurring in the 'next_marker' function of the libvips library. This issue was reported through OSS-Fuzz, indicating that it can lead to a crash or potentially allow for arbitrary code execution if exploited. The crash state shows that the overflow happens during the reading and consuming of markers, which can be triggered by malformed input data. This vulnerability poses a medium severity risk, as it can affect the stability and security of applications relying on libvips.
How To Fix
Minimum fixed version
4689cda680c2b59bf8dca0b856fb58087196f60a
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can validate and sanitize input data before processing it with libvips to prevent malformed data from triggering the vulnerability. This can be done by implementing checks on the input format and size before passing it to the library functions.
Conclusion
The heap buffer overflow vulnerability in libvips poses a medium risk to applications using this library. It is crucial to update to the patched version to mitigate potential security risks. Additionally, implementing input validation can serve as a temporary workaround while the update is applied.
See every vulnerability recorded for libvips →
FAQ
A heap buffer overflow occurs when a program writes more data to a buffer located on the heap than it was allocated for, potentially overwriting adjacent memory and leading to crashes or security vulnerabilities.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By simply uploading your manifest file like package-lock.json, you can check if your application is affected by this vulnerability.
The consequences can include application crashes, data corruption, or even arbitrary code execution if an attacker exploits the vulnerability.
Yes, validating and sanitizing input data before processing it with libvips can help prevent exploitation of this vulnerability.
You can find more information about libvips on its official GitHub repository and check for reported vulnerabilities on platforms like OSS-Fuzz and Vulert.
References
Related vulnerabilities
Recent vulnerabilities recorded for libvips.