CVE-2022-38229
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
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.
- 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
- Attacker generates malicious PDF with crafted DCT Huffman table
- Malicious file is delivered via email, web download, or shared storage
- Victim opens the PDF using xpdf (or an application embedding it)
- readHuffSym overflows the heap buffer during JPEG/DCT decoding
- 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
- CVE-2024-7868 In Xpdf 4.05 (and earlier), invalid header info in a DCT (JPEG) stream can lead to an… Also affects ipe
- CVE-2024-7867 In Xpdf 4.05 (and earlier), very large coordinates in a page box can cause an integer… Also affects ipe
- CVE-2024-7866 In Xpdf 4.05 (and earlier), a PDF object loop in a pattern resource leads to infinite… Also affects ipe
- CVE-2024-4976 Out-of-bounds array write in Xpdf 4.05 and earlier, due to missing object type check in… Also affects ipe
- CVE-2024-4568 In Xpdf 4.05 (and earlier), a PDF object loop in the PDF resources leads to infinite… Also affects ipe
- CVE-2024-4141 Out-of-bounds array write in Xpdf 4.05 and earlier, triggered by an invalid character… Also affects ipe
- CVE-2024-3900 Out-of-bounds array write in Xpdf 4.05 and earlier, triggered by long Unicode sequence in… Also affects ipe
- CVE-2024-3247 In Xpdf 4.05 (and earlier), a PDF object loop in an object stream leads to infinite… Also affects ipe