Cloudanix VulnDB

CVE-2024-31570

None

CVSS

—

EPSS

0.6%

Published

Apr 12, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A problem in a common image-handling component lets attackers run their own programs simply by tricking the software into opening a specially made picture file.

Exploitation
Requires User Interaction
Attacker needs
None
Complexity
Moderate
Impact
Remote Code Execution
Component
Library
Class
Buffer Overflow
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Stack-based buffer overflow write in the Load() function during XPM image parsing allows an attacker to overwrite the stack and achieve arbitrary code execution.

Why it matters to the business

Processing a malicious image file with an affected application can result in full system compromise, data theft, or ransomware deployment; the library's wide use in imaging and graphics tools increases exposure across many products.

How an attack unfolds

An attacker creates a specially crafted XPM file that triggers excessive data writes during parsing; the file is supplied to any application that invokes FreeImage's Load() routine on untrusted input, causing the overflow and subsequent shellcode execution.

How to fix it

Update the FreeImage library to the latest available version that resolves the XPM parsing flaw; if no update exists, disable XPM support or sandbox applications that process untrusted images.

How to confirm the fix worked

Confirm the FreeImage version in use is newer than 3.19.0 r1909; test that malformed XPM files no longer cause crashes or unexpected code paths in the Load() function.

Typical attack path

  1. Craft malicious XPM image that exceeds expected buffer sizes
  2. Deliver the image via file upload, email attachment, or web content
  3. Victim application calls FreeImage Load() on the XPM data
  4. Overflow overwrites return address or stack variables
  5. Attacker-supplied code executes with the privileges of the host process

How to detect it

Review application and system logs for segmentation faults or crashes immediately after XPM image loading attempts; correlate with file-access events involving .xpm extensions from untrusted sources.

What your security team should do

  • Inventory all applications and dependencies that ship or link FreeImage
  • Prioritize patching or replacing the library in internet-facing or high-privilege contexts
  • Implement input validation or file-type restrictions to block XPM where feasible
  • Add runtime monitoring for image-processing crashes as a temporary control

The record

In FreeImage library version 3.19.0 [r1909], when reading images in XPM format, the Load() function has a stack overflow write vulnerability, which may lead to a command execution.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 freeimage 0 No fix
Debian:12 freeimage 0 No fix
Debian:13 freeimage 0 No fix
Debian:14 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