CVE-2026-128064
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
PHP is a general-purpose scripting language used mostly for web development. It runs behind web servers through server APIs such as Apache mod_php and PHP-FPM, and powers content management systems and frameworks such as WordPress, Drupal, Moodle and Laravel. PHP's stream wrappers let functions such as file_get_contents() and fopen() open http://, https://, ftp:// and ftps:// URLs directly.
An Information Exposure vulnerability (CVE-2026-128064) has been identified in the HTTP and FTP stream wrappers of PHP, which causes a request to an HTTPS or FTPS URL to be sent without TLS when the scheme is written with an uppercase S, for example HTTPS://, httpS:// or FTPS://. An attacker who can observe the network traffic can then read passwords, authentication tokens, request bodies or transferred files. The PHP project tracks this issue as GHSA-f6gg-rchx-xw8j.
Per MITRE CWE-319: The product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.
This issue affects all versions of PHP before 8.2.36, PHP 8.3 before 8.3.37, PHP 8.4 before 8.4.28 and PHP 8.5 before 8.5.13, which includes the End-of-Life release lines PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 through their final releases.
Details
Module Info
- Product: PHP
- Affected packages:
php-src(ext/standard) - Affected versions: <8.2.36, >=8.3.0 <8.3.37, >=8.4.0 <8.4.28, >=8.5.0 <8.5.13
- GitHub repository: https://github.com/php/php-src
- Published packages: https://www.php.net/downloads
- Package manager: N/A
- Fixed in:
- OSS PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13
- NES for PHP
Vulnerability Info
This High-severity vulnerability is found in the HTTP and FTP stream wrappers of all versions of PHP before 8.2.36, PHP 8.3 before 8.3.37, PHP 8.4 before 8.4.28 and PHP 8.5 before 8.5.13, which includes the End-of-Life release lines PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 through their final releases. The PHP project scores it 8.2 under CVSS 4.0 (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N).
The wrappers match URL schemes without regard to case, but they decide whether to use TLS by looking for a lowercase s at a fixed position in the scheme. In PHP 8.5.12, the HTTP wrapper reads:
use_ssl = (ZSTR_LEN(resource->scheme) > 4) && ZSTR_VAL(resource->scheme)[4] == 's';
/* choose default ports */
if (use_ssl && resource->port == 0)
resource->port = 443;
else if (resource->port == 0)
resource->port = 80;
A URL whose scheme is written as HTTPS is accepted by the HTTP wrapper, fails this test and is fetched over plain HTTP on port 80. The FTP wrapper applies the same test to the fourth character of the scheme. A URL that passes an application's own case-insensitive HTTPS or FTPS check can therefore use the unencrypted transport.
The HTTP issue also applies to redirect targets. A 307 redirect from a valid HTTPS connection to a URL with an uppercase scheme can cause the preserved POST body and any retained authentication headers to be sent in cleartext. Data can be disclosed even if the destination rejects the unexpected plaintext connection.
Exploitation requires an affected URL to reach a stream wrapper, directly or through a redirect, and an attacker with access to the resulting network traffic. Exposed data can include Basic authentication credentials, bearer tokens, cookies, POST data, FTP login credentials and file contents. The same fixed-position test is present in the final releases of the End-of-Life PHP 5.6 through 8.1 lines.
The fix compares the complete scheme without regard to case, in both wrappers:
use_ssl = zend_string_equals_literal_ci(resource->scheme, "https");
/* choose default ports */
if (use_ssl && resource->port == 0)
resource->port = 443;
else if (resource->port == 0)
resource->port = 80;
Mitigation
The PHP project publishes security fixes only for its supported release lines. PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 are End-of-Life and will not receive any public updates to address this issue.
Until an upgrade is possible, make sure HTTPS and FTPS URL schemes are written in lowercase before they are passed to a stream function. If HTTP redirects are allowed, disable automatic redirects and validate and normalize every redirect target before following it; normalizing only the first URL does not protect redirected requests.
Users of the affected components should apply one of the following mitigations:
- Upgrade to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, or later.
- Leverage a commercial support partner like HeroDevs (NES for PHP) for post-EOL security support.
Credits
- Kushalkhemka (finder)
- Jakub Zelenka (remediation)