CVE-2022-38236
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
A bug in the xpdf program can let attackers take control of a computer simply by getting someone to open a specially made PDF file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Global buffer overflow in Lexer::getObj(Object*) at /xpdf/Lexer.cc allows out-of-bounds memory reads/writes during PDF tokenization and object parsing.
Why it matters to the business
Attackers may gain code execution on endpoints that use xpdf to open malicious PDFs, enabling data theft, ransomware deployment, or persistence on developer and document-processing systems.
How an attack unfolds
An attacker crafts a PDF containing malformed tokens that overflow the global buffer inside Lexer::getObj. The file is delivered via email or web download; when the victim opens it with xpdf the overflow occurs and is used to redirect control flow to attacker-supplied shellcode.
How to fix it
Upgrade xpdf to a build that includes commit ffaf11c or a later patched release. Where no fixed package is published, replace xpdf with a maintained PDF viewer and disable xpdf in automated document pipelines.
How to confirm the fix worked
Confirm the installed xpdf binary is built from source after ffaf11c; run regression test suites containing the original crashing input; verify absence of the vulnerable Lexer.cc path via static analysis.
Typical attack path
- Generate malicious PDF that triggers Lexer::getObj overflow
- Host or send the PDF to the target
- Victim opens the file with xpdf (local UI action)
- Overflow corrupts memory and executes payload
How to detect it
Monitor process crash logs and core dumps for xpdf segfaults or SIGABRT while parsing PDFs; inspect file-access telemetry for unexpected PDF files opened by xpdf shortly before anomalous process behavior.
What your security team should do
- Remove or replace xpdf on all endpoints until a fixed build is deployed
- Block execution of xpdf via application allow-listing where feasible
- Add PDF sandboxing or conversion steps before any xpdf usage
The record
XPDF commit ffaf11c was discovered to contain a global-buffer overflow via Lexer::getObj(Object*) at /xpdf/Lexer.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