CVE-2022-38231
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
A bug in a common PDF reading tool can let attackers take control of a computer simply by getting someone to open a specially crafted 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::getChar at Stream.cc allowing memory corruption when processing malformed DCT streams in PDF files.
Why it matters to the business
Attackers can potentially execute arbitrary code or crash systems using vulnerable XPDF when users open malicious PDFs. The issue has been public for over four years with exploit code available but low exploitation probability.
How an attack unfolds
An attacker crafts a PDF containing a malformed DCT stream that overflows the heap buffer in DCTStream::getChar when the file is opened in XPDF, leading to memory corruption and possible code execution. Public exploit code exists and can be repurposed for targeted attacks.
How to fix it
Upgrade XPDF to a version containing the fix for commit ffaf11c or later if released by the project; otherwise migrate to a maintained alternative PDF viewer. Apply operating-system level PDF sandboxing or content-disarmament tools as an interim control.
How to confirm the fix worked
Confirm XPDF binary version and source commit history to ensure the vulnerable DCTStream::getChar implementation has been replaced. Test with publicly available proof-of-concept PDFs that target the DCT stream path.
Typical attack path
- Craft a malicious PDF embedding a malformed DCT stream designed to trigger the overflow
- Deliver the PDF to the target via email, web download, or shared storage
- Victim opens the PDF using a vulnerable XPDF binary
- DCTStream::getChar processes the stream and triggers the heap overflow
- Attacker achieves memory corruption potentially leading to code execution or denial of service
How to detect it
Search process execution logs and crash reports for XPDF binaries terminating with segmentation faults or heap-related errors while handling PDF files. Review file-access logs for suspicious PDFs opened shortly before anomalous process behavior.
What your security team should do
- Replace or isolate XPDF installations on endpoints that handle untrusted PDFs
- Block or sandbox XPDF execution via application allow-listing where feasible
- Deploy PDF scanning gateways that detect malformed DCT streams before user delivery
- Monitor EPSS and exploit availability updates given the four-year public disclosure window
The record
XPDF commit ffaf11c was discovered to contain a heap-buffer overflow via DCTStream::getChar() 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