CVE-2022-38334
Medium · 5.5CVSS
5.5
EPSS
0.4%
Published
Sep 15, 2022
CISA due date
—
Cloudanix analysis
An older PDF viewer can unexpectedly stop working when someone tries to open a specially crafted document file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow in Catalog::countPageTree during PDF page tree parsing that results in application crash on malformed input.
Why it matters to the business
Document viewing workflows are interrupted by crashes when users open certain PDF files; no data loss or remote code execution occurs but productivity is affected until the reader is replaced.
How an attack unfolds
An attacker crafts a PDF with an excessively deep or malformed page tree that overflows the stack inside countPageTree. The file is opened locally by a user running XPDF 4.04 or earlier, triggering the crash and denial of service.
How to fix it
Migrate away from XPDF 4.04 and earlier to a maintained PDF reader; if XPDF must be retained, apply any subsequent upstream patches that correct the page-tree handling logic.
How to confirm the fix worked
Attempt to open the original proof-of-concept PDF and other deep page-tree test cases; confirm the application no longer crashes and that the function is absent or bounds-checked in the binary.
Typical attack path
- Generate a PDF containing a page tree that triggers excessive recursion or oversized structures
- Deliver the PDF to the target via email, web download, or file share
- User opens the file with the vulnerable XPDF binary
- Catalog::countPageTree overflows the stack and the process terminates
How to detect it
Inspect local crash reports, core dumps, and application logs for faults originating from Catalog.cc or the countPageTree symbol when PDF files are processed.
What your security team should do
- Remove or replace XPDF installations with a supported viewer
- Block execution of xpdf binaries older than the current release via application allow-listing
- Add PDF readers to the vulnerability scanning inventory and enforce regular updates
The record
XPDF v4.04 and earlier was discovered to contain a stack overflow via the function Catalog::countPageTree() at Catalog.cc.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Mageia:9 | xpdf | 0 | 4.05-1.mga9 |
| 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-2023-3436 Xpdf 4.04 will deadlock on a PDF object stream whose "Length" field is itself in another… Also affects xpdf
- CVE-2023-3044 An excessively large PDF page size (found in fuzz testing, unlikely in normal PDF files)… Also affects xpdf
- CVE-2023-2664 In Xpdf 4.04 (and earlier), a PDF object loop in the embedded file tree leads to infinite… Also affects xpdf
- CVE-2023-2663 In Xpdf 4.04 (and earlier), a PDF object loop in the page label tree leads to infinite… Also affects xpdf
- CVE-2023-2662 In Xpdf 4.04 (and earlier), a bad color space object in the input PDF file can cause a… Also affects xpdf
- CVE-2022-45587 Stack overflow vulnerability in function gmalloc in goo/gmem.cc in xpdf 4.04, allows… Also affects xpdf
- CVE-2022-45586 Stack overflow vulnerability in function Dict::find in xpdf/Dict.cc in xpdf 4.04, allows… Also affects xpdf
- CVE-2022-43071 A stack overflow in the Catalog::readPageLabelTree2(Object*) function of XPDF v4.04… Also affects xpdf