CVE-2024-41311

8.1 HIGH

📋 TL;DR

CVE-2024-41311 is an out-of-bounds read/write vulnerability in Libheif's ImageOverlay::parse() function when processing malicious HEIF files with forged offsets. This allows attackers to potentially execute arbitrary code or cause denial of service. Anyone using Libheif to process HEIF images is affected.

💻 Affected Systems

Products:
  • Libheif
  • Applications using Libheif library
Versions: Libheif <= 1.17.6
Operating Systems: Linux, Windows, macOS, BSD
Default Config Vulnerable: ⚠️ Yes
Notes: Any application that uses Libheif to decode HEIF files is vulnerable

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise

🟠

Likely Case

Application crash (denial of service) or information disclosure

🟢

If Mitigated

Application crash with limited impact if sandboxed

🌐 Internet-Facing: MEDIUM - Requires processing malicious HEIF files, which could be uploaded to web services
🏢 Internal Only: LOW - Requires user interaction to open malicious files

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Proof of concept available in GitHub gist, exploitation requires user to process malicious HEIF file

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Libheif 1.17.7 and later

Vendor Advisory: https://github.com/strukturag/libheif/commit/a3ed1b1eb178c5d651d6ac619c8da3d71ac2be36

Restart Required: No

Instructions:

1. Update Libheif to version 1.17.7 or later. 2. Recompile any applications using Libheif. 3. Restart affected services if they were running with vulnerable version.

🔧 Temporary Workarounds

Disable HEIF processing

all

Temporarily disable HEIF file processing in applications

Input validation

all

Implement strict file type validation before processing

🧯 If You Can't Patch

  • Implement strict file upload restrictions for HEIF files
  • Run applications in sandboxed/containerized environments

🔍 How to Verify

Check if Vulnerable:

Check Libheif version with: libheif --version or dpkg -l | grep libheif

Check Version:

libheif --version

Verify Fix Applied:

Verify version is 1.17.7 or higher: libheif --version | grep -q '1\.1[7-9]\.[7-9]'

📡 Detection & Monitoring

Log Indicators:

  • Application crashes when processing HEIF files
  • Memory access violation errors

Network Indicators:

  • Unusual HEIF file uploads to web services

SIEM Query:

source="application.log" AND ("segmentation fault" OR "access violation") AND "heif"

🔗 References

📤 Share & Export