
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-31826 is a denial-of-service vulnerability in pypdf, a free and open-source pure-Python PDF library, caused by improper handling of manipulated stream length values that can exhaust system RAM. An attacker can craft a malicious PDF containing a content stream with an inflated /Length value that does not match the actual data length, causing the library to allocate excessive memory during parsing. All pypdf versions prior to 6.8.0 are affected; the vulnerability was disclosed on March 9, 2026, and published to the NVD on March 10, 2026. It carries a CVSS v3.1 base score of 5.5 (Medium) and a CVSS v4.0 base score of 6.8 (Medium) (Github Advisory, Red Hat Bugzilla).
The root cause is CWE-770 (Allocation of Resources Without Limits or Throttling): pypdf's content stream parser trusts the /Length dictionary value in a PDF stream object without validating it against the actual available data, leading to unbounded memory allocation. An attacker crafts a PDF where the /Length field specifies a very large value (e.g., 2 GB) while the actual stream data is minimal; when pypdf reads the stream from a buffer of unknown size (such as one returned by open("file.pdf", mode="rb")), it attempts to allocate memory proportional to the declared length. The fix, implemented in PR #3675, limits the allowed /Length value to prevent excessive allocation (pypdf Security Advisory, pypdf PR #3675). Notably, passing a file path or a BytesIO buffer to pypdf does not appear to trigger the vulnerability — only reading from raw file buffers of unknown size is affected (Github Advisory).
Successful exploitation results in excessive memory consumption on the host running pypdf, potentially crashing the application or exhausting system resources and causing denial of service to legitimate users. There is no impact on confidentiality or integrity — only availability is affected. Applications that automatically process user-supplied or externally sourced PDF files (e.g., document management systems, AI pipelines using pypdf) are at greatest risk, as a single crafted PDF can trigger resource exhaustion (Github Advisory, Red Hat Bugzilla).
There is no public proof-of-concept exploit code and no evidence of in-the-wild exploitation at this time (Github Advisory). The EPSS score is approximately 0.013% (0th percentile), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires passive user interaction — a victim application or user must open or parse the crafted PDF — and no threat actor attribution has been reported.
/Length dictionary entry is set to an extremely large value (e.g., 2,147,483,648 for ~2 GB), while the actual stream data is minimal or empty.open("file.pdf", mode="rb")), which is the code path vulnerable to this issue. Applications passing file paths or BytesIO objects are not affected./Length value, rapidly consuming available RAM and potentially crashing the application or the host system (pypdf Security Advisory, pypdf PR #3675)./Length values in stream objects (detectable via PDF forensic tools).The primary remediation is to upgrade pypdf to version 6.8.0 or later, which limits the allowed /Length value in stream objects (pypdf Release 6.8.0). For environments where immediate patching is not possible, the changes from PR #3675 can be applied manually as a workaround (pypdf PR #3675). Additionally, as a short-term mitigation, pass file paths or BytesIO buffers to pypdf instead of raw file handles opened with open("file.pdf", mode="rb"), as this code path does not appear to trigger the vulnerability. Restricting PDF processing to trusted sources and monitoring applications for abnormal memory consumption are also recommended defensive measures (Github Advisory). IBM has also released a patch for affected watsonx Orchestrate products (IBM Advisory).
The vulnerability was reported by researcher iconnnjka and analyzed by pypdf maintainer stefan6419846, who promptly released the fix in version 6.8.0 on March 9, 2026 (pypdf Security Advisory). Red Hat tracked the issue via Bugzilla and Oracle included it in their April 2026 security bulletin, indicating broad awareness across enterprise software vendors (Red Hat Bugzilla, Oracle Advisory). No significant social media controversy or widespread community debate has been observed around this vulnerability.
Fix availability across major Linux distributions and their releases.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."