CVE-2021-40263
High · 8.8CVSS
8.8
EPSS
1.2%
Published
Aug 22, 2023
CISA due date
—
Cloudanix analysis
A flaw in an image handling library can let attackers take over a program simply by tricking it into opening a bad picture file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap overflow during TIFF image loading in the ofLoad function of PluginTIFF.cpp allows memory corruption when processing a crafted file.
Why it matters to the business
Applications embedding the library can be compromised when users open malicious images, leading to potential data breaches or system takeover with no official fixed release available.
How an attack unfolds
An attacker supplies a specially crafted TIFF image that triggers the heap overflow on load; with public exploits available, the malformed data overwrites memory structures to achieve arbitrary code execution in the context of the host application.
How to fix it
Upgrade to a patched fork or later version of FreeImage that resolves the TIFF loader issue; where no upstream fix exists, replace the library with an alternative image processing component or implement strict input validation and sandboxing around image handling.
How to confirm the fix worked
Confirm FreeImage version is not 1.18.0, run regression tests with known trigger TIFF files, and verify absence of the vulnerable ofLoad path via static analysis or fuzzing.
Typical attack path
- Craft malicious TIFF file exploiting the overflow in ofLoad
- Deliver the file via email, web download, or shared storage
- Victim application opens the image using FreeImage
- Heap corruption occurs leading to code execution or crash
How to detect it
Search application logs and crash dumps for abnormal behavior during TIFF loading; monitor for heap-related exceptions or memory corruption signals in processes that call into FreeImage.
What your security team should do
- Inventory all products and dependencies using FreeImage 1.18.0
- Prioritize migration away from the unmaintained library
- Apply runtime sandboxing or process isolation for image processing
- Monitor for public exploit usage given available proof-of-concept code
The record
A heap overflow vulnerability in FreeImage 1.18.0 via the ofLoad function in PluginTIFF.cpp.
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