CVE-2026-134129 in pdfparser
Summary
by MITRE • 11/27/2026
smalot/pdfparser before 2.14.0 contains an inefficient algorithmic complexity vulnerability that allows remote attackers to cause a denial of service by submitting a crafted PDF with deeply nested unbalanced parentheses in a content-stream string. Attackers can exploit the regex-based string isolation loop in PDFObject::formatContent(), which rescans growing content on each pass to produce O(n^2) processing time, causing a small PDF to stall or exhaust PHP worker resources for seconds to minutes.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/28/2026
The vulnerability identified in smalot/pdfparser versions prior to 2.14.0 represents a significant algorithmic complexity flaw that undermines the reliability and availability of applications relying on this library for PDF processing. This issue is classified under CWE-400, which denotes uncontrolled resource consumption due to inefficient algorithms. The core technical defect resides within the PDFObject::formatContent() method, specifically in its handling of content-stream strings through a regex-based isolation loop. When parsing PDF files that contain deeply nested and unbalanced parentheses within their content streams, the library fails to optimize string manipulation operations. Instead of processing the data with linear efficiency, the implementation rescans increasingly larger portions of the content on each iteration pass. This architectural oversight results in quadratic time complexity, denoted as O(n^2), where n represents the size or depth of the nested structure within the PDF file.
From an operational perspective, this vulnerability enables remote attackers to execute a denial-of-service attack against systems utilizing the affected library. By submitting a specially crafted PDF document characterized by deeply nested unbalanced parentheses, an attacker can trigger excessive CPU consumption and memory allocation on the server side. The impact is particularly severe in environments where PHP worker resources are constrained or shared among multiple requests. A relatively small malicious file can cause the processing thread to stall for seconds or even minutes as it attempts to resolve the exponentially growing computational load. This behavior effectively exhausts available worker threads, leading to service degradation or complete unavailability for legitimate users attempting to access PDF-related functionalities within the application ecosystem.
The exploitation of this flaw aligns with ATT&CK technique T1496, which covers Resource Hijacking, specifically focusing on CPU consumption as a means to disrupt normal operations. Unlike vulnerabilities that compromise confidentiality or integrity, this issue targets availability by leveraging inefficient code paths to create computational bottlenecks. The lack of bounds checking or optimized parsing strategies for nested structures allows the regex engine to perform redundant scans, amplifying the processing time disproportionately relative to the input size. This characteristic makes it a potent vector for automated denial-of-service campaigns targeting web applications that accept user-uploaded PDF documents without prior sanitization or resource limits.
To mitigate this vulnerability, organizations must immediately upgrade smalot/pdfparser to version 2.14.0 or later, where the algorithmic inefficiency has been addressed through optimized parsing logic and improved handling of nested structures. For systems unable to update promptly due to dependency constraints, implementing strict input validation is critical. This includes limiting the depth of nesting allowed in PDF content streams and enforcing size limits on uploaded files to prevent excessively large processing tasks from consuming server resources. Additionally, deploying web application firewalls or custom middleware that inspects incoming PDF uploads for signs of maliciously nested structures can provide an additional layer of defense. Monitoring system metrics such as CPU usage and thread pool saturation during PDF parsing operations can also aid in detecting potential exploitation attempts in real-time, allowing for rapid incident response before service availability is critically impacted.