CVE-2021-40264
Medium · 6.5CVSS
6.5
EPSS
0.7%
Published
Aug 22, 2023
CISA due date
—
Cloudanix analysis
A bug in a popular image-handling library can make programs crash when they open certain files, potentially interrupting services until the software is updated.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
NULL pointer dereference in FreeImage_CloneTag allows remote attackers to trigger a crash in applications that process crafted image files with the library.
Why it matters to the business
Applications relying on the library can experience unexpected crashes and service interruptions when handling untrusted image content, increasing operational downtime and support costs until the library is updated.
How an attack unfolds
An attacker creates a specially malformed image file containing metadata that triggers the NULL dereference path inside FreeImage_CloneTag. The file is delivered to a target application that uses the vulnerable library version; when the application loads or displays the image the dereference occurs and the process terminates.
How to fix it
Upgrade FreeImage to version 1.18.0 or later. Rebuild and redeploy any dependent applications after the library update. Where immediate upgrade is not feasible, isolate image-processing components and apply strict input validation or sandboxing around file handling.
How to confirm the fix worked
Confirm the installed FreeImage library version is 1.18.0 or newer. Re-test affected applications with known triggering image samples to verify absence of crashes. Monitor build pipelines to ensure the updated library is linked.
Typical attack path
- Craft malicious image file with tag data designed to reach FreeImage_CloneTag with a NULL pointer
- Deliver the file to the victim via web upload, email attachment, or other untrusted input channel
- Victim application invokes FreeImage to load or manipulate the image
- Library dereferences NULL pointer and crashes the hosting process
How to detect it
Review application and system logs for segmentation faults or abrupt process terminations occurring during image load operations. Correlate crashes with FreeImage usage by inspecting loaded libraries or stack traces that reference FreeImageTag.cpp.
What your security team should do
- Immediately inventory all products and containers that statically or dynamically link FreeImage and schedule upgrades to 1.18.0+
- Prioritize patching for any internet-facing or high-volume image-processing services
- Add library version checks to vulnerability scanning and SBOM processes
- Consider runtime sandboxing or input filtering for image-handling code until patches are deployed
The record
NULL pointer dereference vulnerability in FreeImage before 1.18.0 via the FreeImage_CloneTag function inFreeImageTag.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