CVE-2022-38238
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
A bug in a common PDF viewing program can let attackers take control of 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
- Patch
- Effort
- Low
- Patch risk
- Low
What it actually does
Heap buffer overflow in DCTStream::lookChar() at Stream.cc allows out-of-bounds memory access during processing of malformed DCT streams inside PDF files.
Why it matters to the business
Attackers can gain code execution on systems that open malicious PDFs with the affected viewer, enabling data theft, ransomware deployment, or persistence on user workstations.
How an attack unfolds
An attacker crafts a PDF containing a specially malformed DCT stream. When the victim opens the file in the vulnerable XPDF binary, DCTStream::lookChar triggers the heap overflow, allowing control of execution flow.
How to fix it
Upgrade XPDF to the first patched release that resolves the overflow in Stream.cc; if no official fixed build is yet published, replace the binary with a maintained alternative PDF viewer until an update is available.
How to confirm the fix worked
Confirm the installed XPDF binary is newer than commit ffaf11c, run regression tests with known trigger PDFs, and verify absence of crashes or sanitizer violations during DCT decoding.
Typical attack path
- Craft malicious PDF embedding malformed DCT data
- Deliver file via email attachment, web download, or shared storage
- Victim opens the PDF using the vulnerable XPDF binary
- DCTStream::lookChar performs out-of-bounds write on the heap
- Attacker payload gains code execution or causes denial of service
How to detect it
Hunt for XPDF process crashes or segmentation faults correlated with PDF file opens in system logs; inspect for heap-related sanitizer reports or unusual memory allocation patterns during DCT stream handling.
What your security team should do
- Immediately replace XPDF on all endpoints with a patched or alternative viewer
- Block or sandbox XPDF execution for high-risk user populations until fixed
- Add PDF file-type restrictions in email gateways and browser download policies
- Monitor vulnerability feeds for official XPDF patch release and expedite deployment
The record
XPDF commit ffaf11c was discovered to contain a heap-buffer overflow via DCTStream::lookChar() 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