CVE-2022-38227
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 16, 2022
CISA due date
—
Cloudanix analysis
A flaw in a common PDF reading tool can let an attacker take over a computer if someone opens a specially made document.
- 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
Stack-based buffer overflow triggered during memcpy in XPDF's PDF parsing, allowing adjacent stack memory corruption when processing a maliciously crafted file.
Why it matters to the business
Local compromise of systems that render PDFs with the affected XPDF binary can lead to arbitrary code execution under the user's privileges, disrupting document workflows and requiring urgent patching across developer and research environments that depend on this library.
How an attack unfolds
An attacker creates a PDF that triggers the overflow on parse, then delivers it via email or web. When a victim opens the file locally with XPDF, the memcpy overwrites the stack, enabling control-flow hijacking and shellcode execution.
How to fix it
Upgrade to a patched XPDF release once available; in the interim, avoid opening untrusted PDFs with XPDF and consider alternative PDF viewers or sandboxed execution environments.
How to confirm the fix worked
Confirm the installed XPDF binary is newer than commit ffaf11c and test against known proof-of-concept files that previously triggered the memcpy crash.
Typical attack path
- Craft malicious PDF exploiting the stack overflow in XPDF commit ffaf11c
- Host or send the file to a target user
- User opens the document with the vulnerable XPDF binary
- Overflow occurs during __asan_memcpy, corrupting stack state
- Attacker gains local code execution
How to detect it
Review process creation logs and file-access telemetry for invocations of the XPDF binary against recently received or unusual PDF files; look for segmentation faults or abnormal crashes in XPDF shortly after document open.
What your security team should do
- Immediately restrict XPDF usage on untrusted documents until a fixed build is deployed
- Monitor for new upstream releases and update affected systems within 30 days
- Add XPDF to the list of high-risk local parsers requiring application whitelisting or containerization
The record
XPDF commit ffaf11c was discovered to contain a stack overflow via __asan_memcpy at asan_interceptors_memintrinsics.cpp.
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