CVE-2026-128064: PHP stream wrapper TLS bypass via mixed-case HTTPS/FTPS URLs
PHP's HTTP and FTP stream wrappers treat URL schemes case-insensitively but only enable TLS when the scheme contains a lowercase 's'. Mixed-case URLs such as HTTPS:// or FTPS:// are handled over plaintext HTTP/FTP, exposing data in transit. Affects PHP 8.2. before 8.2.36, 8.3. before 8.3.37, 8.4. before 8.4.28, and 8.5. before 8.5.13.
Summary
PHP's HTTP and FTP stream wrappers recognise URL schemes case-insensitively, but TLS is enabled only when the scheme contains a lowercase s at the fixed position. A URL such as HTTPS:// or FTPS:// passed to file_get_contents(), fopen(), or other stream functions, or received as an HTTP redirect target, is therefore handled over unencrypted HTTP or FTP.
An attacker able to observe network traffic can read data the application expected TLS to protect, including credentials, request bodies, and transferred files.
Affected versions: - PHP 8.2. before 8.2.36 - PHP 8.3. before 8.3.37 - PHP 8.4. before 8.4.28 - PHP 8.5. before 8.5.13
References: - NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-128064 - PHP advisory: https://github.com/php/php-src/security/advisories/GHSA-f6gg-rchx-xw8j
What to do
1. Identify PHP versions in use across affected applications and compare them against the fixed versions listed above. 2. Patch PHP to 8.2.36, 8.3.37, 8.4.28, or 8.5.13 (or later) per the vendor advisory. 3. If immediate patching is not possible, audit application code and redirect handling for uppercase or mixed-case HTTPS:// and FTPS:// URLs; normalise schemes to lowercase https:///ftps:// or reject non-lowercase schemes. 4. Review network logs for plaintext traffic to sensitive endpoints if exposure is suspected. 5. Verify the vendor advisory before changing production, and test stream wrapper behaviour after patching.