CVE-2021-40266
Medium · 6.5CVSS
6.5
EPSS
1.0%
Published
Aug 22, 2023
CISA due date
—
Cloudanix analysis
A flaw in an image library can make programs crash when they try to open certain picture files, interrupting work that depends on those programs.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Null pointer dereference in the ReadPalette function of PluginTIFF.cpp when processing specially crafted TIFF images, resulting in application crash and denial of service.
Why it matters to the business
Applications and services relying on FreeImage for image handling may experience unexpected crashes when users open or process malicious TIFF files, leading to downtime and potential loss of availability for image-dependent workflows.
How an attack unfolds
An attacker crafts a malicious TIFF image that triggers a null pointer dereference in ReadPalette, then delivers it to a target application using a vulnerable FreeImage version; when the victim opens or processes the image, the application crashes.
How to fix it
Upgrade FreeImage to version 1.18.0 or later. Where immediate upgrade is not possible, implement input validation or sandboxing around image processing components.
How to confirm the fix worked
Confirm FreeImage version is 1.18.0 or newer; test image processing functionality with known-good and boundary-case TIFF files to verify absence of crashes.
Typical attack path
- Identify applications using FreeImage for TIFF processing
- Craft a TIFF image that causes null pointer dereference in ReadPalette
- Deliver the malicious image via email, web upload, or file share
- Victim opens or processes the image triggering the crash
How to detect it
Review application logs and crash dumps for segmentation faults or null pointer exceptions occurring during TIFF image loading or palette reading operations.
What your security team should do
- Prioritize upgrade to FreeImage 1.18.0 across all affected systems
- Monitor for application crashes during image processing and investigate unusual patterns
- Restrict untrusted image file handling until patched
The record
FreeImage before 1.18.0, ReadPalette function in PluginTIFF.cpp is vulnerabile to null pointer dereference.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | freeimage | 0 | No fix |
| Debian:12 | freeimage | 0 | No fix |
| Debian:13 | freeimage | 0 | No fix |
| Ubuntu:20.04:LTS | freeimage | 0 | No fix |
| Ubuntu:22.04:LTS | freeimage | 0 | No fix |
| Ubuntu:24.04:LTS | freeimage | 0 | No fix |
| Ubuntu:24.10 | freeimage | 0 | No fix |
| Ubuntu:25.04 | freeimage | 0 | No fix |
| Ubuntu:25.10 | freeimage | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | freeimage | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | freeimage | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | freeimage | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | freeimage | 0 | No fix |
Related vulnerabilities
- CVE-2024-9029 A flaw was found in the freeimage library. Also affects freeimage
- CVE-2024-31570 In FreeImage library version 3.19.0 [r1909], when reading images in XPM format, the… Also affects freeimage
- CVE-2024-28583 Buffer Overflow vulnerability in open source FreeImage v.3.19.0 [r1909] allows a local… Also affects freeimage
- CVE-2024-28584 Null Pointer Dereference vulnerability in open source FreeImage v.3.19.0 [r1909] allows a… Also affects freeimage
- CVE-2024-28578 Buffer Overflow vulnerability in open source FreeImage v.3.19.0 [r1909] allows a local… Also affects freeimage
- CVE-2024-28579 Buffer Overflow vulnerability in open source FreeImage v.3.19.0 [r1909] allows a local… Also affects freeimage
- CVE-2024-28580 Buffer Overflow vulnerability in open source FreeImage v.3.19.0 [r1909] allows a local… Also affects freeimage
- CVE-2024-28582 Buffer Overflow vulnerability in open source FreeImage v.3.19.0 [r1909] allows a local… Also affects freeimage