lopdf has a stack overflow via deeply nested PDF objects
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.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The lopdf library's Document::load_mem function and related entry points parse nested PDF arrays and dictionaries using recursion without a limit on nesting depth. A maliciously crafted PDF with approximately 10,000 nested array levels in the Catalog's /X entry causes the parser to exhaust the call stack, triggering a SIGABRT and crashing the process. This stack overflow results in a denial of service against applications using lopdf to parse untrusted PDF input. The vulnerability affects lopdf versions before 0.42.0 and is resolved by introducing a maximum nesting depth limit in the parser to prevent unbounded recursion.
Potential Impact
An attacker can cause a denial of service by submitting a small (~21 KB) crafted PDF file with deeply nested arrays, crashing any service that uses lopdf versions prior to 0.42.0 for PDF parsing. There is no impact on confidentiality or integrity, only availability is affected.
Mitigation Recommendations
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.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-6fj4-rcr3-r7rr
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["crates.io"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6ad2aeed2cdf04f656455610
Added to database: 10/16/2026, 23:10:37 UTC
Last enriched: 10/16/2026, 23:14:15 UTC
Last updated: 10/16/2026, 23:14:15 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.