CVE-2022-38228
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 document file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Patch
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap buffer overflow in DCTStream::transformDataUnit during JPEG DCT coefficient processing allows out-of-bounds memory writes when parsing specially crafted image data inside PDF files.
Why it matters to the business
Attackers can achieve arbitrary code execution or cause denial of service on any workstation or server that opens malicious PDFs with this PDF viewer, risking data theft, ransomware deployment, or loss of system availability.
How an attack unfolds
An attacker creates a PDF containing a JPEG stream with malformed DCT data that triggers the overflow in transformDataUnit. The victim opens the file locally using the vulnerable XPDF binary, causing the overflow to corrupt heap memory and allowing the attacker to redirect execution to attacker-controlled code.
How to fix it
Replace XPDF with a maintained PDF reader such as poppler-utils, MuPDF, or a modern browser PDF engine. If XPDF must remain in use, rebuild from source after applying upstream patches that address the Stream.cc buffer handling or switch to a fork with active maintenance.
How to confirm the fix worked
Confirm the installed xpdf binary is newer than commit ffaf11c and test against known trigger PDFs; monitor process crashes or memory sanitizer reports when opening untrusted documents.
Typical attack path
- Craft malicious PDF embedding JPEG with oversized or invalid DCT coefficients
- Deliver PDF via email, web download, or shared storage
- Victim opens file with vulnerable XPDF binary
- DCTStream::transformDataUnit performs out-of-bounds write on heap
- Attacker payload gains control of instruction pointer or achieves RCE
How to detect it
Review system logs and EDR telemetry for XPDF processes that terminate unexpectedly or exhibit heap corruption signals when opening PDF files; correlate with file creation timestamps of suspicious documents.
What your security team should do
- Immediately remove or sandbox XPDF installations on all endpoints
- Block opening of untrusted PDFs with legacy viewers via application allow-listing
- Deploy EDR rules that alert on XPDF processes writing to unexpected memory regions
- Scan historical email and file shares for PDFs that may trigger DCT parsing paths
The record
XPDF commit ffaf11c was discovered to contain a heap-buffer overflow via DCTStream::transformDataUnit 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