Cloudanix VulnDB

CVE-2022-38229

High · 7.8

CVSS

7.8

EPSS

0.3%

Published

Aug 16, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in PDF reading software can let an attacker take over a computer simply by tricking someone into opening a specially made document file.

Exploit Available
Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Full Compromise
Component
Application
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Heap-buffer overflow in DCTStream::readHuffSym allows out-of-bounds memory writes when parsing malformed Huffman tables inside DCT streams of PDF files.

Why it matters to the business

Attackers can execute arbitrary code on systems that render untrusted PDFs, leading to full host compromise, data theft, or ransomware deployment; the issue affects any workflow that relies on xpdf for document processing.

How an attack unfolds

An attacker crafts a PDF containing a DCT stream with an oversized or malformed Huffman table. When the victim opens the file, xpdf's DCTStream::readHuffSym performs an unchecked write beyond the allocated buffer, allowing the attacker to corrupt heap metadata and ultimately hijack control flow for code execution.

How to fix it

Upgrade xpdf to a version that contains the corrected Stream.cc logic; if no patched release is available, replace xpdf with an alternative PDF viewer that is actively maintained and apply strict file-type filtering or sandboxing for any remaining xpdf usage.

How to confirm the fix worked

Confirm the installed xpdf binary is built from source newer than commit ffaf11c or run regression tests that feed known-malformed DCT PDFs and verify absence of crashes or sanitizer violations.

Typical attack path

  1. Attacker generates malicious PDF with crafted DCT Huffman table
  2. Malicious file is delivered via email, web download, or shared storage
  3. Victim opens the PDF using xpdf (or an application embedding it)
  4. readHuffSym overflows the heap buffer during JPEG/DCT decoding
  5. Attacker gains arbitrary code execution on the local system

How to detect it

Search process execution logs and crash reports for xpdf invocations that terminate with segmentation faults or heap corruption signals while processing files containing DCT streams; correlate with file-creation timestamps of PDFs received from external sources.

What your security team should do

  • Immediately inventory all systems and containers using xpdf and block its execution on untrusted PDFs until patched
  • Replace xpdf with a maintained alternative (poppler, pdfium, or mupdf) in production document workflows
  • Add PDF sandboxing or conversion-to-image steps in mail gateways and file-sharing services
  • Monitor EPSS and exploit availability; prepare emergency patching if EPSS rises

The record

XPDF commit ffaf11c was discovered to contain a heap-buffer overflow via DCTStream::readHuffSym(DCTHuffTable*) at /xpdf/Stream.cc.

Affected packages

Ecosystem Package Introduced Fixed
Ubuntu:16.04:LTS ipe 0 No fix
Ubuntu:18.04:LTS ipe 0 No fix
Ubuntu:20.04:LTS ipe 0 No fix
Ubuntu:22.04:LTS ipe 0 No fix
Ubuntu:24.04:LTS ipe 0 No fix
Ubuntu:24.10 ipe 0 No fix
Ubuntu:25.04 ipe 0 No fix
Ubuntu:25.10 ipe 0 No fix
Ubuntu:Pro:16.04:LTS ipe 0 No fix
Ubuntu:Pro:18.04:LTS ipe 0 No fix
Ubuntu:Pro:20.04:LTS ipe 0 No fix

Related vulnerabilities