CVE-2026-128016 in FrankenPHP
Summary
by MITRE • 11/13/2026
FrankenPHP before 1.13.4 contains a use-after-free vulnerability in worker mode that frees internal streams of SplTempFileObject or SplFileObject on php://temp instances surviving across requests. Remote clients can send requests reaching code that uses such persisted objects, causing reads of freed memory that leak garbage data or crash the process.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/13/2026
The identified vulnerability represents a critical use-after-free condition within FrankenPHP versions prior to 1.13.4, specifically affecting operations conducted in worker mode. This architectural choice is common in high-performance PHP environments where persistent processes handle multiple requests to reduce initialization overhead. However, the flaw arises from improper memory management of internal streams associated with SplTempFileObject or SplFileObject instances when these objects are instantiated on php://temp wrappers and persist across distinct HTTP request boundaries. In a typical worker-based architecture, stateful objects may remain in memory between requests for performance optimization, but this persistence introduces significant risk if the underlying resources are not correctly invalidated or reallocated upon request completion.
The technical root cause lies in the lifecycle management of these specific PHP stream wrappers. When an application utilizes SplTempFileObject or SplFileObject with a php://temp destination, the system allocates memory to buffer data before potentially flushing it to disk if size thresholds are exceeded. In FrankenPHP worker mode, if such objects survive across requests without proper cleanup mechanisms, their internal file pointers and associated memory buffers remain allocated but logically stale relative to the new request context. When subsequent remote clients send requests that trigger code paths interacting with these persisted objects, the application attempts to read from or write to memory regions that have already been freed by previous operations or garbage collection cycles. This discrepancy between logical object existence and physical memory validity constitutes a classic use-after-free vulnerability.
The operational impact of this flaw is severe due to its potential for remote exploitation. Attackers can craft specific HTTP requests designed to trigger the execution paths involving these vulnerable stream objects. By doing so, they can induce reads from freed memory regions, leading to information disclosure where sensitive data previously stored in those memory locations may be leaked back to the client as garbage or partial content. Furthermore, depending on the heap layout and timing of subsequent allocations, this out-of-bounds read can corrupt internal structures, causing process crashes that result in denial of service conditions. In more sophisticated scenarios involving controlled heap grooming, such vulnerabilities could potentially lead to arbitrary code execution, although the primary immediate risks are data leakage and system instability.
This vulnerability aligns with CWE-416, which describes use-after-free errors where a pointer is used after it has been freed, leading to undefined behavior. From an offensive security perspective, this scenario maps closely to MITRE ATT&CK techniques related to memory corruption exploitation and potentially T1059 for command execution if the crash or leak facilitates further lateral movement. The persistence of state across requests in worker mode amplifies the attack surface compared to traditional request-per-process models where memory is fully isolated per transaction.
Mitigation strategies must prioritize immediate version upgrades to FrankenPHP 1.13.4 or later, as these releases contain patches addressing the lifecycle management of internal streams for SplTempFileObject and SplFileObject in worker mode. Until an upgrade can be performed, administrators should consider disabling persistent worker modes if feasible within their deployment architecture, thereby ensuring that memory is fully reclaimed after each request regardless of object persistence logic. Additionally, implementing strict input validation and limiting the use of complex file stream objects in long-running processes can reduce exposure. Monitoring for unusual process crashes or unexpected data leakage patterns may also serve as an early detection mechanism for exploitation attempts targeting this specific flaw.