PHP Fixes Mixed-Case HTTPS/FTPS Plaintext Bug
PHP fixed CVE-2026-128064, a stream-wrapper flaw that could send mixed-case HTTPS and FTPS requests in plaintext in some cases.
Reporting cutoff: 2026-11-19, 21:35 UTC
PHP maintainers have fixed a flaw in the language’s built-in HTTP and FTP stream wrappers that could cause URLs written as `HTTPS://`, `httpS://` or `FTPS://` to be sent without transport-layer encryption. The vulnerability, tracked as CVE-2026-128064, could expose credentials, authentication tokens, request bodies and transferred files to an attacker able to observe the resulting network traffic.
The PHP security advisory published on 19 November describes the problem as a mismatch between two parts of the stream-wrapper implementation: URL schemes are recognised without regard to case, but the code that decides whether to enable TLS checked for a lowercase `s` at a fixed character position. The result was that an application could accept a mixed-case secure URL while PHP selected the corresponding plaintext HTTP or FTP transport.
The issue is not a break in TLS itself. It is a scheme-handling bug in PHP’s own stream wrappers.
How the case mismatch disabled encryption
PHP’s stream wrappers allow functions such as `file_get_contents()` and `fopen()` to work with URLs, including HTTP, HTTPS, FTP and FTPS. Applications can also supply stream contexts containing request headers, authentication information or POST data.
The vulnerable implementation used a case-sensitive character check to decide whether the scheme required TLS. In the historical HTTP wrapper, the relevant test examined the character at position four for a lowercase `s`; the FTP wrapper used the corresponding position-three check. That works for lowercase `https` and `ftps`, but not for `HTTPS` or `FTPS`.
The URL parser’s case-insensitive handling and the transport-selection check therefore disagreed. A mixed-case URL could be accepted as a secure scheme but proceed over ordinary HTTP or FTP.

The fix compares the complete scheme using a case-insensitive comparison. The fixed PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0 source tags inspected for this report use that approach in both the HTTP and FTP wrappers.
This is a long-standing code pattern. The same lowercase-only checks are present in the PHP 5.1.6 source tree, in both wrapper files. That establishes that the behaviour existed at least by PHP 5.1.6; it does not establish the exact release in which the defect was first introduced. The social-media summary’s reference to PHP 5.2.0 is therefore not the earliest version visible in the source history reviewed here.
What could be exposed
The upstream advisory says applications using `file_get_contents()`, `fopen()` or other PHP stream functions could transmit sensitive information without encryption. Depending on the request, that information could include:
- Credentials and authentication headers supplied by the application;
- Sensitive POST bodies;
- FTP login credentials; and
- Files being transferred through the affected wrappers.
The redirect behaviour makes the flaw more consequential than a simple mistake in a URL supplied directly by an application. The advisory specifically describes an HTTP 307 redirect from a valid HTTPS connection to a mixed-case HTTPS destination. A 307 response preserves the request method and body; if PHP follows the redirect using the vulnerable wrapper, the POST body and retained authentication headers may be sent over plaintext HTTP.

The advisory notes that data can be disclosed even if the destination rejects the unexpected plaintext request. The confidentiality failure occurs when the sensitive request is sent onto the network without TLS, not only when the destination successfully processes it.
This is not an automatic compromise of every PHP installation. The affected path must use PHP’s built-in HTTP or FTP stream wrappers, and an attacker must be able to observe the resulting network traffic. The vulnerability does not describe a general failure of HTTPS or every PHP HTTP client. In particular, the documented code path is the built-in stream-wrapper implementation, not the separate cURL extension.
Affected versions and fixed releases
The PHP Group’s GitHub security advisory lists these affected and patched release lines:
| Branch | Affected versions in the advisory | Fixed release |
|---|---|---|
| PHP 8.2 | 8.2.0–8.2.35 | 8.2.36 |
| PHP 8.3 | 8.3.0–8.3.36 | 8.3.37 |
| PHP 8.4 | 8.4.0–8.4.27 | 8.4.28 |
| PHP 8.5 | 8.5.0–8.5.12 | 8.5.13 |
The PHP 8.6.0 source tag also contains the corrected case-insensitive checks. PHP 8.6.0 is not listed in the GHSA affected-version table, which enumerates the 8.2–8.5 maintenance branches. A Canadian government advisory also lists 8.6.0 among the fixed releases.
There is an unresolved version-scope discrepancy that should not be hidden. The human-readable GHSA table starts its first affected range at PHP 8.2.0. The structured CVE record encodes that first range with a lower bound of `0` and an upper bound of 8.2.36. Zend’s separate advisory identifies affected ZendPHP builds in the 7.2, 7.3, 7.4 and 8.1 lines, as well as the older pre-patch 8.2–8.5 builds. Those Zend product ranges are vendor-maintained builds, not additional upstream PHP Group release entries.
The source history shows that the relevant code pattern existed before PHP 8.2, but source snapshots alone do not prove that every intervening PHP release and downstream build had identical behaviour. Administrators running end-of-life PHP or vendor-supported builds should check the advisory from their own distribution or support provider rather than assuming the upstream table covers their package.
Severity and exploitation status
The CVE record assigns CVSS 4.0: 8.2 (High) and classifies the weakness as CWE-319: Cleartext Transmission of Sensitive Information. Its vector records a network attack, low attack complexity, attack requirements present, no required privileges and no user interaction, with high confidentiality impact and no direct integrity or availability impact.
Zend labels the issue Moderate in its own security centre. That is a different vendor severity label; it should not replace the CVE record’s stated CVSS score.
The CVE record’s CISA-contributed SSVC enrichment, timestamped 19 November, records exploitation as “none” and automation as “no”. This is a point-in-time assessment, not proof that exploitation is impossible or that no unreported incident exists. The sources reviewed for this report do not establish confirmed exploitation in the wild.
What administrators should do
The primary mitigation is to upgrade to the fixed release for the PHP branch in use:
- PHP 8.2: upgrade to 8.2.36 or later in that branch;
- PHP 8.3: upgrade to 8.3.37 or later;
- PHP 8.4: upgrade to 8.4.28 or later; and
- PHP 8.5: upgrade to 8.5.13 or later.
For PHP 8.6, the 8.6.0 source tag inspected contains the corrected comparison. Administrators using ZendPHP or another downstream distribution should follow that vendor’s own fixed-build guidance, particularly on older branches.
The upstream advisory gives a temporary workaround: ensure HTTPS and FTPS schemes are lowercase before passing URLs to PHP stream functions. That check must also cover redirect destinations. Normalising only the initial URL is insufficient if the wrapper automatically follows a redirect to a mixed-case target. Where appropriate, disable automatic redirects and validate and normalise each redirect target before following it.
Applications should review code paths that construct remote URLs, accept URLs from external input or attach sensitive data to stream requests. The key question is not simply whether the initial URL begins with lowercase `https://`, but whether every URL that reaches the wrapper—including redirect targets—uses the expected scheme and transport.
CVE-2026-128064 is a reminder that a secure-looking URL is not itself proof that a client selected an encrypted transport. In this case, the mismatch was in PHP’s decision to enable TLS, and the fix is to make that decision case-insensitive as well.
Sources
- PHP Group security advisory GHSA-f6gg-rchx-xw8j
- CVE-2026-128064 record
- PHP 8.2.36 release, PHP 8.3.37, PHP 8.4.28 and PHP 8.5.13
- Zend security advisory for CVE-2026-128064
- PHP 5.1.6 HTTP wrapper source and FTP wrapper source
- PHP 8.5.13 HTTP wrapper source and FTP wrapper source
- PHP 8.6.0 HTTP wrapper source and FTP wrapper source
- Canadian Centre for Cyber Security advisory
AI-assisted content
This story was drafted and/or edited with AI assistance and reviewed before publishing.
Explore more topics
Related stories

OpenAI and Cisco Launch Shirudo, an Experimental Runtime Shield for Linux
OpenAI and Cisco have open-sourced Shirudo, a project designed to deploy temporary protections while teams prepare software patches. Its first public demonstration is narrow, and the project’s own documentation says it is not ready for production.

