☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-41311

CVE-2024-41311 Out-of-Bounds Access in Libheif
📅 PUBLISHED: 2024-10-15 00:00 UTC 🔄 UPDATED: 2026-09-23 20:38 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix ⏳ CVSS score pending NVD analysis
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.81%
👁️
0.81% probability
20.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-41311 is a critical memory safety vulnerability in Libheif version 1.17.6, specifically within the ImageOverlay::parse() function. The flaw arises from insufficient validation of offset values when decoding a HEIF file containing an overlay image. An attacker can craft a malicious HEIF file with forged offsets, leading to an out-of-bounds (OOB) read and write condition. This can result in memory corruption, potential code execution, or denial of service. The vulnerability has a CVSS score of 0.0 (placeholder) and an EPSS score of 0.0%, indicating low exploitation probability at this time, but the technical severity is high due to the nature of OOB access. No public proof-of-concept (PoC) or patch is currently available.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Libheif is a widely used library for handling HEIF/HEIC image formats, commonly integrated into image processing tools, media players, and web applications. This vulnerability affects any software that uses the vulnerable version of Libheif (1.17.6) to parse HEIF files with overlay images. The lack of a patch increases supply chain risk, as downstream consumers must rely on workarounds or wait for an official fix.

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (placeholder – actual score pending NVD analysis)
  • Attack Vector (AV): Local (requires user to open a malicious file)
  • Attack Complexity (AC): Low
  • Privileges Required (PR): None
  • User Interaction (UI): Required (user must open the file)
  • Scope (S): Unchanged
  • Confidentiality (C): High (OOB read can leak memory)
  • Integrity (I): High (OOB write can corrupt memory)
  • Availability (A): High (can cause crash or code execution)
  • Threat Level: High (due to potential for code execution and memory corruption)

Deep Dive & Mechanics

The vulnerability resides in the ImageOverlay::parse() method of Libheif 1.17.6. When parsing a HEIF file that contains an overlay image, the function reads offset values from the file structure without proper bounds checking. These offsets are used to calculate memory addresses for reading and writing pixel data. By providing forged offset values, an attacker can cause the function to access memory outside the allocated buffer, leading to:

  • Out-of-bounds read: Leak sensitive information from adjacent memory regions.
  • Out-of-bounds write: Overwrite critical data structures, potentially leading to arbitrary code execution.

The root cause is the lack of validation that the computed memory address falls within the bounds of the allocated buffer for the overlay image. This is a classic memory corruption vulnerability common in C/C++ libraries.

Vulnerable vs. Patched Code

Vulnerable Code (Libheif 1.17.6):

// Simplified vulnerable code in ImageOverlay::parse()
void ImageOverlay::parse(StreamReader& reader) {
    // ... read overlay offsets from file
    int offset_x = reader.read32(); // no bounds check
    int offset_y = reader.read32(); // no bounds check
    // ... use offsets to access pixel data
    uint8_t* pixel_data = buffer + offset_y * stride + offset_x;
    // OOB access if offsets are forged
}

Patched Code (Hypothetical fix):

// Patched version with bounds checking
void ImageOverlay::parse(StreamReader& reader) {
    int offset_x = reader.read32();
    int offset_y = reader.read32();
    // Validate offsets against buffer dimensions
    if (offset_x < 0 || offset_x >= width || offset_y < 0 || offset_y >= height) {
        throw std::runtime_error("Invalid overlay offset");
    }
    uint8_t* pixel_data = buffer + offset_y * stride + offset_x;
    // Safe access
}

Exploitation & Lab Setup

Red Team

Lab Setup:

  1. Install Libheif 1.17.6 on a test system (e.g., Ubuntu 22.04).
  2. Create a malicious HEIF file with forged overlay offsets using a hex editor or custom script.
  3. Use a tool like heif-convert or a custom application that calls ImageOverlay::parse() to trigger the vulnerability.

Exploitation Steps:

  1. Craft a HEIF file with an overlay image item containing offset values that point outside the allocated buffer.
  2. Deliver the file to the target (e.g., via email, web download).
  3. When the target opens the file with a vulnerable application, the OOB write can corrupt memory, potentially leading to code execution.

Note: No public exploit code is available. The following is a conceptual example of a malicious HEIF structure:

# Conceptual Python script to generate a malicious HEIF file
import struct

def create_malicious_heif():
    # Simplified HEIF structure with forged overlay offsets
    ftyp = b'ftypheic'  # File type box
    meta = b'meta'      # Metadata box
    # Overlay item with forged offsets (e.g., offset_x = 0xFFFFFFFF, offset_y = 0xFFFFFFFF)
    overlay_data = struct.pack('<II', 0xFFFFFFFF, 0xFFFFFFFF)  # Forged offsets
    # ... build full HEIF file
    return ftyp + meta + overlay_data

with open('malicious.heic', 'wb') as f:
    f.write(create_malicious_heif())

Blue Team

Detection:

  • Monitor for crashes or abnormal memory access patterns in applications using Libheif.
  • Use memory protection mechanisms (ASLR, DEP) to mitigate exploitation.
  • Implement file scanning for HEIF files with suspicious overlay offsets.

Hunting:

  • Search for logs containing "ImageOverlay::parse" or "heif" errors.
  • Analyze network traffic for HEIF file downloads from untrusted sources.

Indicators of Compromise (IOCs)

  • File Hashes (SHA256): (None available – placeholder)
  • Network Indicators: HEIF files with unusual overlay offsets (e.g., extremely large or negative values).
  • Behavioral Indicators: Application crashes or memory corruption errors when processing HEIF files.
  • Registry/File System: Temporary files created by vulnerable applications during HEIF parsing.

Detection Engineering

YARA Rule

rule CVE_2024_41311_Libheif_OOB {
    meta:
        description = "Detects malicious HEIF files exploiting CVE-2024-41311"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-41311"
    strings:
        $heif_magic = { 66 74 79 70 68 65 69 63 } // "ftypheic"
        $overlay_offset = { FF FF FF FF FF FF FF FF } // Forged offset pattern
    condition:
        $heif_magic and $overlay_offset
}

Sigma Rule

title: CVE-2024-41311 Libheif Out-of-Bounds Access
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2024-41311 via application crashes
author: Valters IT
date: 2025-04-10
logsource:
    category: application
    product: libheif
detection:
    selection:
        EventID: 1000  # Application crash event
        Image: '*heif*'
        ExceptionCode: 0xc0000005  # Access violation
    condition: selection
falsepositives:
    - Legitimate crashes due to other bugs
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-41311 - Malicious HEIF File Download"; flow:to_client; file.data; content:"ftypheic"; offset:0; depth:8; content:"|FF FF FF FF FF FF FF FF|"; within:100; classtype:attempted-user; sid:1000001; rev:1;)

Remediation & Mitigation

  • Immediate: Disable processing of HEIF overlay images in applications using Libheif 1.17.6 until a patch is available.
  • Patch: Monitor the Libheif project for an official fix (expected in a future release). Apply the patch as soon as it is released.
  • Workaround: Use input validation to reject HEIF files with suspicious overlay offsets (e.g., offsets exceeding image dimensions).
  • Long-term: Implement fuzz testing for HEIF parsing code to catch similar vulnerabilities.

Valters IT – DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-41311/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.