lopdf has a stack overflow via deeply nested PDF objects
Affects lopdfSource GCVE Database
CVSS 7.5 High : upgrade to 0.42.0 soon.
Data as of 16 Oct 2026, 23:14 UTC
- Patch
- Available – fixed in 0.42.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HWhat to do
Upgrade lopdf to 0.42.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| crates.iolopdf | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in lopdf version 0.42.0 which enforces a maximum object-nesting depth in the PDF parser to prevent unbounded recursion and stack overflow. Users should upgrade to version 0.42.0 or later to remediate this vulnerability.
Description
lopdf versions prior to 0.42.0 contain a stack overflow vulnerability in the PDF parser due to unbounded recursion when processing deeply nested PDF arrays or dictionaries. A crafted PDF with around 10,000 levels of nested arrays in the Catalog can cause the parser to exhaust the call stack and abort the process with SIGABRT, resulting in a denial of service. This vulnerability does not cause a panic that can be caught, making it effective for crashing services that parse untrusted PDFs. The issue is fixed in lopdf version 0.42.0 by enforcing a maximum object-nesting depth.
References
- github.com/J-F-Liu/lopdf/issues/502 (opens in a new tab)
- github.com/J-F-Liu/lopdf/pull/503 (opens in a new tab)
- github.com/J-F-Liu/lopdf/commit/c755394ad7dd651ccfe77c618f90ab779da1dfd9 (opens in a new tab)
- github.com/J-F-Liu/lopdf (opens in a new tab)
- rustsec.org/advisories/RUSTSEC-2026-0187.html (opens in a new tab)