pypdf: manipulated stream length values can exhaust RAM
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 3 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-770.
Summary
pypdf is a free and open-source pure-python PDF library. Prior to 6.8.0, an attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires parsing a content stream with a rather large /Length value, regardless of the actual data length inside the stream. This vulnerability is fixed in 6.8.0.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| py-pdf | pypdf | before 6.8.0 | 6.8.0 | Patch available | CNA |
| — | pypdf (PyPI) | before 6.8.0 | 6.8.0 | Patch available | GHSA-hqmh-ppp3-xvm7 |
- pypdf Vendorpy-pdf Affected before 6.8.0 Fixed in 6.8.0 Patch available CNA
- pypdf (PyPI) Vendor— Affected before 6.8.0 Fixed in 6.8.0 Patch available GHSA-hqmh-ppp3-xvm7
Remediation
- Fix · CNA pypdf (py-pdf) Fixed in 6.8.0
- Fix · GHSA-hqmh-ppp3-xvm7 pypdf (PyPI) Fixed in 6.8.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Lightspeed | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-31826
- 2026-10-03 Alias added: GHSA-hqmh-ppp3-xvm7
References
Patch 2
More py-pdf Pypdf vulnerabilities
- TI-2023-18601 Infinite Loop when reading malformed objects in pypdf CVSS 3.1MEDIUM 6.5
- TI-2023-18305 Infinite Loop when a comment isn't followed by a character in pypdf CVSS 3.1MEDIUM 6.2
- TI-2026-42743 pypdf: Possible infinite loop for not terminated inline images CVSS 4.0HIGH 8.7
- TI-2026-42742 pypdf: Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter) CVSS 4.0HIGH 8.7
- TI-2026-65557 pypdf: Possible large memory usage when retrieving alphabetical page labels CVSS 4.0HIGH 8.7
- TI-2026-65556 pypdf: Possible long runtimes with large amount of embedded files CVSS 4.0HIGH 8.7
Sources
- CVE-2026-31826 · CVE Program
- CVE-2026-31826 · NVD
- FIRST EPSS
- GHSA-hqmh-ppp3-xvm7 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-31826 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences