CVE-2020-24295
📋 TL;DR
CVE-2020-24295 is a buffer overflow vulnerability in FreeImage's PSD parser that allows remote attackers to execute arbitrary code by providing a specially crafted PSD file. This affects any application using FreeImage 3.19.0 to process PSD files, potentially leading to complete system compromise.
💻 Affected Systems
- FreeImage
- Applications using FreeImage library
📦 What is this software?
Freeimage by Freeimage Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with full system compromise, allowing attackers to install malware, exfiltrate data, or create persistent backdoors.
Likely Case
Application crash leading to denial of service, with potential for limited code execution depending on memory protections.
If Mitigated
Application crash without code execution if ASLR/DEP are properly implemented and effective.
🎯 Exploit Status
The vulnerability requires only a crafted PSD file to trigger. Public discussions and advisories indicate exploit details are available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: FreeImage 3.19.0 with patch or later versions
Vendor Advisory: https://sourceforge.net/p/freeimage/discussion/36111/thread/afb98701eb/
Restart Required: Yes
Instructions:
1. Update FreeImage library to patched version. 2. Recompile applications using FreeImage. 3. Restart affected services. 4. Verify PSD file processing works correctly.
🔧 Temporary Workarounds
Disable PSD file processing
allConfigure applications to reject or not process PSD files through FreeImage
# Application-specific configuration required
Input validation for PSD files
allImplement strict validation of PSD file headers before passing to FreeImage
# Custom validation logic required based on application
🧯 If You Can't Patch
- Implement network segmentation to isolate systems processing PSD files
- Deploy application firewalls to inspect and block malicious PSD files
🔍 How to Verify
Check if Vulnerable:
Check FreeImage version: ldd /path/to/application | grep freeimage and verify version is 3.19.0 r1859
Check Version:
strings /usr/lib/libfreeimage.so.3 | grep 'FreeImage Version' || freeimage-config --version
Verify Fix Applied:
Verify FreeImage version is updated and test with known safe PSD files to ensure functionality
📡 Detection & Monitoring
Log Indicators:
- Application crashes when processing PSD files
- Memory access violation errors in application logs
- Unexpected process termination
Network Indicators:
- Unusual outbound connections from image processing services
- Large PSD file uploads followed by abnormal behavior
SIEM Query:
source="application.log" AND ("segmentation fault" OR "access violation" OR "buffer overflow") AND "psd"
🔗 References
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HFRQ76ZDPSWT7OH6FJDLSFWBXVBE6JDN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M6GKMK74POW3RU7F4HLUJE7XEFLQDO35/
- https://sourceforge.net/p/freeimage/discussion/36111/thread/afb98701eb/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HFRQ76ZDPSWT7OH6FJDLSFWBXVBE6JDN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M6GKMK74POW3RU7F4HLUJE7XEFLQDO35/
- https://sourceforge.net/p/freeimage/discussion/36111/thread/afb98701eb/