Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-93682 Overview
CVE-2026-93682 is an out-of-bounds read vulnerability in the PHP HTTP stream wrapper. When the wrapper follows a redirect and the server returns a Location header with an empty value, the redirect code reads one byte past the end of the heap buffer that holds the location string. The value of that out-of-bounds byte determines which redirect target the client builds, so a malicious server can influence whether the client is sent to the host root or to the current directory. The flaw is tracked under [CWE-125] (Out-of-Bounds Read) and is network-reachable without authentication or user interaction.
Critical Impact
A malicious HTTP server can trigger an out-of-bounds read in PHP clients using the HTTP stream wrapper and steer redirect targets based on uninitialized heap memory.
Affected Products
- PHP (php-src) HTTP stream wrapper
- Applications and libraries using fopen, file_get_contents, or similar functions against http:// or https:// URLs with redirect following enabled
- Downstream distributions bundling vulnerable PHP builds
Discovery Timeline
- 2026-09-25 - CVE-2026-93682 published to NVD
- 2026-09-29 - Last updated in NVD database
Technical Details for CVE-2026-93682
Vulnerability Analysis
The PHP HTTP stream wrapper parses response headers while following redirects. When it encounters a Location header, it extracts the target value and constructs the next request URL. If the header value is empty, the parsing logic advances a pointer past the end of the allocated buffer and dereferences the next byte. That byte lies outside the heap allocation holding the header value.
The out-of-bounds byte drives a branching decision: depending on its value, the wrapper either treats the redirect as pointing to the host root (/) or resolves it relative to the current directory. Because the byte originates from adjacent heap memory, its content is attacker-influenced but not fully attacker-controlled.
Root Cause
The root cause is missing bounds validation on an empty Location header value before the redirect resolution code reads the following byte. The parser assumes the header value contains at least one character and does not check the string length prior to indexing past it.
Attack Vector
Exploitation requires a PHP client to issue an HTTP request to a server controlled by the attacker, with redirect following enabled (the default for the stream wrapper). The attacker returns a response containing an empty Location header. The PHP process then performs the out-of-bounds read, and the redirect target the client follows is determined by the leaked byte. Scenarios include server-side URL fetchers, webhook consumers, feed readers, and update checkers that call PHP HTTP functions against untrusted URLs. Refer to the GitHub Security Advisory GHSA-7875-c8px-7q5f for technical details.
Detection Methods for CVE-2026-93682
Indicators of Compromise
- HTTP responses to PHP clients containing a Location: header with no value, followed by a \r\n sequence
- Unexpected redirects from PHP processes to the host root / of untrusted servers
- PHP process crashes or ASan reports referencing the HTTP stream wrapper redirect code path
Detection Strategies
- Inspect outbound HTTP traffic from application servers for responses with empty Location headers originating from external hosts
- Correlate PHP error logs and segmentation faults with stream wrapper activity (fopen, file_get_contents, stream_get_contents against http:// URLs)
- Run PHP under AddressSanitizer in test environments to surface the one-byte heap over-read when fuzzing HTTP responses
Monitoring Recommendations
- Log and alert on PHP worker crashes and unexpected restarts in php-fpm or CLI worker pools
- Track egress HTTP destinations from PHP services and flag redirects to attacker-adjacent domains
- Monitor web application firewall and proxy logs for malformed redirect responses returned to internal clients
How to Mitigate CVE-2026-93682
Immediate Actions Required
- Upgrade PHP to a version containing the fix referenced in the PHP Security Advisory GHSA-7875-c8px-7q5f
- Audit application code that calls HTTP stream functions against untrusted or user-supplied URLs
- Restrict outbound HTTP destinations from PHP services to an allowlist where feasible
Patch Information
Apply the PHP update distributed by your operating system vendor or install an upstream PHP release that includes the fix for the HTTP stream wrapper redirect handling. Review the upstream advisory for the exact fixed versions and commit identifiers.
Workarounds
- Disable redirect following by setting the follow_location stream context option to 0 when fetching untrusted URLs
- Replace fopen and file_get_contents HTTP calls with a hardened HTTP client such as cURL and validate redirect targets explicitly
- Route PHP outbound HTTP traffic through a forward proxy that strips or rejects responses with empty Location headers
# Disable automatic redirect following for untrusted HTTP fetches in PHP
$ctx = stream_context_create([
'http' => [
'follow_location' => 0,
'max_redirects' => 0,
'timeout' => 10,
],
]);
$body = file_get_contents('http://untrusted.example/resource', false, $ctx);
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

