CVE-2022-24107
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Aug 30, 2022
CISA due date
—
Cloudanix analysis
An old flaw in the Xpdf PDF viewer can let an attacker take control of a computer if someone opens a specially crafted PDF file, but the problem has been fixed for years and shows almost no signs of being used by attackers.
- 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
Missing integer overflow check in JPXStream.cc allows crafted JPEG2000 data inside a PDF to trigger a buffer overflow, enabling arbitrary code execution with the privileges of the Xpdf process.
Why it matters to the business
Successful local exploitation can lead to full compromise of a workstation when a user opens a malicious PDF, potentially resulting in data theft, ransomware deployment, or persistence; however, the issue is more than four years old with negligible exploit activity, so immediate operational disruption risk remains low for most environments.
How an attack unfolds
An attacker creates a PDF containing a malformed JPEG2000 stream that triggers the unchecked integer calculation in JPXStream.cc. When the victim opens the file with an affected Xpdf binary, the overflow corrupts memory structures and allows the attacker to redirect execution to attacker-controlled code.
How to fix it
Upgrade glyphandcog xpdfreader to version 4.04 or later; if an upgrade is not immediately feasible, replace Xpdf with a maintained PDF viewer such as poppler-utils, evince, or qpdf and restrict execution of the older binary via application allow-listing.
How to confirm the fix worked
Run 'xpdf -v' or inspect the binary version string to confirm 4.04 or newer is installed; for source builds, verify that JPXStream.cc contains the added overflow checks present in the 4.04 release.
Typical attack path
- Craft a PDF embedding a JPEG2000 image with integer values chosen to overflow JPXStream allocation calculations
- Deliver the PDF via email, web download, or removable media
- Victim opens the file using Xpdf on a local workstation
- Integer overflow occurs during stream parsing, leading to heap or stack corruption and code execution
How to detect it
Search endpoint logs and file-share histories for PDF files opened with Xpdf that match known malicious JPEG2000 stream patterns; monitor for unexpected Xpdf process crashes or child-process creation after PDF handling.
What your security team should do
- Inventory all systems running Xpdf and schedule upgrades to 4.04+ within standard patch windows
- Block or monitor execution of xpdf binaries older than 4.04 via endpoint policy
- Educate users to avoid opening untrusted PDFs with legacy viewers
The record
Xpdf prior to 4.04 lacked an integer overflow check in JPXStream.cc.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Mageia:8 | xpdf | 0 | 4.04-1.mga8 |
| Ubuntu:16.04:LTS | emscripten | 0 | No fix |
| Ubuntu:16.04:LTS | ipe | 0 | No fix |
| Ubuntu:16.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:16.04:LTS | xpdf | 0 | No fix |
| Ubuntu:18.04:LTS | emscripten | 0 | No fix |
| Ubuntu:18.04:LTS | ipe | 0 | No fix |
| Ubuntu:18.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:20.04:LTS | ipe | 0 | No fix |
| Ubuntu:20.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:22.04:LTS | emscripten | 0 | No fix |
| Ubuntu:22.04:LTS | ipe | 0 | No fix |
| Ubuntu:22.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:22.04:LTS | texlive-bin | 0 | 2021.20210626.59705-1ubuntu0.3 |
| Ubuntu:24.04:LTS | emscripten | 0 | No fix |
| Ubuntu:24.04:LTS | ipe | 0 | No fix |
| Ubuntu:24.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:24.10 | emscripten | 0 | No fix |
| Ubuntu:24.10 | ipe | 0 | No fix |
| Ubuntu:24.10 | texlive-bin | 0 | No fix |
| Ubuntu:25.04 | emscripten | 0 | No fix |
| Ubuntu:25.04 | ipe | 0 | No fix |
| Ubuntu:25.04 | texlive-bin | 0 | No fix |
| Ubuntu:25.10 | emscripten | 0 | No fix |
| Ubuntu:25.10 | ipe | 0 | No fix |
| Ubuntu:25.10 | texlive-bin | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | emscripten | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | ipe | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | xpdf | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | emscripten | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | ipe | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | ipe | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | texlive-bin | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | texlive-bin | 0 | 2019.20190605.51237-3ubuntu0.2+esm1 |
Related vulnerabilities
- CVE-2023-43281 Double Free vulnerability in Nothings Stb Image.h v.2.28 allows a remote attacker to… Also affects emscripten
- CVE-2022-36561 XPDF v4.0.4 was discovered to contain a segmentation violation via the component… Also affects emscripten
- 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