Skip to main content

lopdf has a stack overflow via deeply nested PDF objects

0
High
Published: 10/16/2026 (10/16/2026, 19:55:39 UTC)
Source: GCVE Database
Product: lopdf

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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

crates.ioghsa
lopdf
Affected versions
<0.42.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/16/2026, 23:14:15 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses