CVE-2022-38237
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
A flaw in an older PDF viewer can let attackers take over a computer simply by tricking someone into opening a specially made PDF 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::readScan() at /xpdf/Stream.cc allows out-of-bounds memory writes during processing of malformed DCT streams in PDF files.
Why it matters to the business
Attackers can crash the PDF viewer or execute arbitrary code on systems where users open malicious PDFs, potentially leading to data theft, ransomware deployment, or full system compromise in environments relying on this viewer.
How an attack unfolds
An attacker crafts a PDF containing a specially malformed DCT stream that triggers the overflow in readScan when parsed; the victim opens the file locally with the vulnerable XPDF binary, causing the heap corruption that an attacker can turn into code execution.
How to fix it
Upgrade to a patched version of XPDF once available; in the interim replace XPDF with a maintained PDF viewer such as poppler-based tools or MuPDF and restrict execution of untrusted PDF files.
How to confirm the fix worked
Confirm XPDF binary version is newer than the affected commit ffaf11c, run regression tests with known malformed DCT PDFs, and verify that readScan no longer performs unbounded writes via code review or sanitizer builds.
Typical attack path
- Create malicious PDF embedding crafted DCT data designed to overflow the heap buffer
- Deliver the PDF to the target via email attachment, web download, or shared storage
- Victim opens the PDF using the vulnerable XPDF application on their system
- DCTStream::readScan processes the stream and writes beyond allocated heap memory
- Attacker leverages the corruption for arbitrary code execution or denial of service
How to detect it
Search application crash logs and core dumps for references to Stream.cc or DCTStream::readScan; inspect process execution history for xpdf launched against recently received PDF files from external sources.
What your security team should do
- Immediately restrict XPDF usage for untrusted documents and prefer alternative viewers
- Monitor upstream XPDF repository for security patches addressing Stream.cc
- Deploy application allow-listing to prevent execution of older XPDF binaries
- Educate users on risks of opening PDFs from unknown sources
The record
XPDF commit ffaf11c was discovered to contain a heap-buffer overflow via DCTStream::readScan() 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