Memory exhaustion via unchecked stream length
Published Mar 10, 2026 · Updated Mar 10, 2026
Resource exhaustion in py-pdf pypdf before 6.8.0 allows attackers to consume memory by supplying a crafted PDF content stream. DictionaryObject.read_from_stream trusts the stream's declared /Length and passes it to stream.read without enforcing a maximum, allocating memory for data absent from the file. The PDF must be parsed from a buffer of unknown size, such as an open binary file object; file paths and BytesIO buffers are not reported to trigger the issue.
Summary
What happened
Resource exhaustion in py-pdf pypdf before 6.8.0 allows attackers to consume memory by supplying a crafted PDF content stream. DictionaryObject.read_from_stream trusts the stream's declared /Length and passes it to stream.read without enforcing a maximum, allocating memory for data absent from the file. The PDF must be parsed from a buffer of unknown size, such as an open binary file object; file paths and BytesIO buffers are not reported to trigger the issue.
The record
- CVE
- CVE-2026-31826
- Published
- Mar 10, 2026
- Updated
- Mar 10, 2026
- Vendor
- py-pdf
- Product
- pypdf
- Classifications
- CWE-770, T1499
- Attack vector
- local
- Privileges
- unauthenticated
Timeline
How it unfolded
- Mar 10, 2026CVE publishedPublication date reported by the CVE source.
- Mar 10, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 6.8.0
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- read_from_stream__length_2gb.pdf regression proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo