CVE-2025-66293
📋 TL;DR
CVE-2025-66293 is an out-of-bounds read vulnerability in libpng's simplified API that allows reading up to 1012 bytes beyond allocated memory when processing valid PNG images with specific characteristics. This affects applications using libpng versions prior to 1.6.52 to process PNG files, potentially exposing sensitive memory contents. The vulnerability is triggered by valid PNG files per specification, making detection difficult.
💻 Affected Systems
- libpng
- Applications using libpng library
📦 What is this software?
Libpng by Libpng
⚠️ Risk & Real-World Impact
Worst Case
Information disclosure of up to 1012 bytes of adjacent heap memory, potentially exposing sensitive data like passwords, keys, or application state.
Likely Case
Application crash or denial of service due to invalid memory access, with possible limited information leakage.
If Mitigated
Minimal impact with proper memory isolation and ASLR, though some information disclosure may still occur.
🎯 Exploit Status
Exploitation requires crafting specific PNG files that trigger the out-of-bounds read condition.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: libpng 1.6.52
Vendor Advisory: https://github.com/pnggroup/libpng/security/advisories/GHSA-9mpm-9pxh-mg4f
Restart Required: Yes
Instructions:
1. Download libpng 1.6.52 or later from official sources. 2. Compile and install the updated library. 3. Recompile any applications using libpng against the new version. 4. Restart affected services and applications.
🔧 Temporary Workarounds
Disable simplified API
allAvoid using libpng's simplified API functions that trigger this vulnerability
Input validation
allReject PNG files with palette color type and partial transparency before processing
🧯 If You Can't Patch
- Implement strict input validation to reject suspicious PNG files
- Isolate PNG processing in sandboxed environments with limited memory access
🔍 How to Verify
Check if Vulnerable:
Check libpng version with 'pngcrush -version' or examine library files for version strings
Check Version:
pngcrush -version 2>&1 | grep -i libpng
Verify Fix Applied:
Verify installed libpng version is 1.6.52 or higher using version checking commands
📡 Detection & Monitoring
Log Indicators:
- Application crashes during PNG processing
- Memory access violation errors
- Unexpected termination of image processing services
Network Indicators:
- Multiple PNG upload attempts with specific characteristics
- Unusual PNG file sizes or structures
SIEM Query:
source="application_logs" AND ("segmentation fault" OR "access violation" OR "libpng") AND "png"
🔗 References
- https://github.com/pnggroup/libpng/commit/788a624d7387a758ffd5c7ab010f1870dea753a1
- https://github.com/pnggroup/libpng/commit/a05a48b756de63e3234ea6b3b938b8f5f862484a
- https://github.com/pnggroup/libpng/issues/764
- https://github.com/pnggroup/libpng/security/advisories/GHSA-9mpm-9pxh-mg4f
- http://www.openwall.com/lists/oss-security/2025/12/03/6
- http://www.openwall.com/lists/oss-security/2025/12/03/7
- http://www.openwall.com/lists/oss-security/2025/12/03/8
- https://github.com/pnggroup/libpng/issues/764