CVE-2026-27888
High · 7.5CVSS
7.5
EPSS
0.7%
Published
Feb 26, 2026
CISA due date
—
Cloudanix analysis
A flaw in a software library for handling PDF files could allow an attacker to crash an application simply by having it process a specially crafted document.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The vulnerability allows for a denial-of-service attack. A specifically crafted PDF file containing a compressed XML Forms Architecture (XFA) stream can trigger excessive memory allocation when processed by a vulnerable version of the pypdf library. This occurs when the library attempts to decompress a stream using FlateDecode that is designed to expand to an extremely large size, exhausting the system's available RAM and causing the application process to crash.
Why it matters to the business
Processing a malicious PDF file can cause the application or service to crash, leading to a denial of service (DoS). This can disrupt business operations that rely on automated document processing, such as file uploads, report generation, or data ingestion systems. The resulting service unavailability can impact user experience, halt critical workflows, and damage the organization's reputation.
How an attack unfolds
An attacker crafts a malicious PDF document containing a compressed XFA stream, which acts as a 'decompression bomb'. The attacker then submits this file to a web application or service that uses a vulnerable version of the pypdf library for processing. When the application's code attempts to access the XFA data within the PDF, the library tries to decompress the malicious stream. The stream is designed to expand exponentially, consuming all available memory on the host system. This memory exhaustion forces the operating system to terminate the application process, resulting in a denial of service.
How to fix it
To remediate this vulnerability, upgrade the pypdf library to version 6.7.3 or later. You can update the package using pip: `pip install --upgrade pypdf>=6.7.3`. If an immediate upgrade is not feasible, a workaround is to manually apply the patch from the commit `05e6d3c03deaec6b16b53825465537ac9e7a1a14` to your local installation of the library.
How to confirm the fix worked
To validate that the vulnerability has been remediated, check the installed version of the pypdf library in all relevant Python environments. Use the command `pip show pypdf` or `pip list | grep pypdf` to confirm that the installed version is 6.7.3 or higher. Additionally, review your project's dependency files (e.g., requirements.txt, Pipfile.lock, poetry.lock) to ensure they specify a non-vulnerable version.
Typical attack path
- The attacker creates a malicious PDF file with a specially crafted, compressed XFA stream.
- The attacker uploads or sends the malicious PDF to a target application that uses the vulnerable pypdf library.
- The application begins processing the PDF and its code accesses the `xfa` property.
- The pypdf library attempts to decompress the malicious stream, triggering uncontrolled memory allocation.
- The application's process runs out of memory and crashes, causing a denial of service.
How to detect it
To detect potential exploitation, monitor applications that use the pypdf library for unexpected crashes or sudden, extreme spikes in memory usage. Review system logs (e.g., Linux OOM killer logs, Windows Event Logs) and application logs for out-of-memory errors or stack traces originating from the pypdf library, particularly those related to decompression or XFA stream processing. Correlate these events with the processing of a specific PDF file, which would be the primary artifact of an attack.
What your security team should do
- Immediately identify all applications and systems using the pypdf library and upgrade them to version 6.7.3 or newer.
- If patching is delayed, consider implementing temporary controls, such as restricting PDF uploads to trusted sources or disabling features that process externally-sourced PDFs.
- Implement resource monitoring and alerting for applications that process PDFs to detect abnormal memory consumption, which could indicate an exploitation attempt.
- Review application logs for crashes or out-of-memory errors related to PDF processing to identify potential past exploitation attempts.
The record
pypdf is a free and open-source pure-python PDF library. Prior to 6.7.3, an attacker who uses this vulnerability can craft a PDF which leads to the RAM being exhausted. This requires accessing the `xfa` property of a reader or writer and the corresponding stream being compressed using `/FlateDecode`. This has been fixed in pypdf 6.7.3. As a workaround, apply the patch manually.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | pypdf | 0 | 6.7.3 |
| openSUSE:Leap 16.0 | python-PyPDF2 | 0 | 2.11.1-bp160.2.1 |
| openSUSE:Tumbleweed | python-PyPDF2 | 0 | 2.11.1-5.1 |
Related vulnerabilities
- GHSA-x7hp-r3qg-r3cj pypdf: Manipulated FlateDecode XFA streams can exhaust RAM Same vulnerability
- CVE-2026-28804 pypdf is a free and open-source pure-python PDF library. Also affects pypdf
- GHSA-9m86-7pmv-2852 pypdf vulnerable to inefficient decoding of ASCIIHexDecode streams Also affects pypdf
- CVE-2026-28351 pypdf is a free and open-source pure-python PDF library. Also affects pypdf
- GHSA-2rw7-x74f-jg35 pypdf has a possible infinite loop when loading circular /Prev entries in cross-reference… Also affects pypdf
- CVE-2026-27628 pypdf is a free and open-source pure-python PDF library. Also affects pypdf
- CVE-2026-27026 pypdf is a free and open-source pure-python PDF library. Also affects pypdf
- CVE-2026-27025 pypdf is a free and open-source pure-python PDF library. Also affects pypdf