
Short version: until November 19, 2026, if a PHP program requested a URL written as HTTPS:// or httpS://, with the S in uppercase, PHP sent it unencrypted, even though it said HTTPS. Passwords, tokens and form data went out in plain text. The flaw is CVE-2026-128064, it has been in the code for about 20 years, and it is fixed in PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13. The same update fixes twelve other vulnerabilities, several of them serious, so the advice is the usual one: update PHP. Below I reproduce it step by step, explain who is really affected (WordPress, for example, is not, in its own functions) and how to protect yourself if you cannot update yet.
What this flaw is
PHP has functions that read a URL as if it were a file: file_get_contents(), fopen(), copy(), file() and others. A huge amount of code uses them to call an API, download a file or query a service:
$response = file_get_contents('https://api.example.com/data');
Internally, those functions look at the start of the URL (the scheme) to decide what to do. That is where the problem was. According to PHP's official advisory, PHP recognizes the scheme case-insensitively, so HTTPS:// and https:// look the same to it. But to decide whether to encrypt the connection with TLS, it checks for a lowercase "s" at a fixed position.
The result: with HTTPS://, PHP understands it is a web request, does not find the lowercase "s", and sends it as plain HTTP, unencrypted. No error, no warning. The same happens with FTPS://, which ends up as unencrypted FTP.
Only that one letter matters. In my tests, Https:// and HTTPs:// are encrypted fine, because the "s" is still lowercase. HTTPS://, httpS:// or hTTpS:// are not.
The key facts:
| Item | Detail |
|---|---|
| ID | CVE-2026-128064 |
| Severity | 8.2 out of 10 (high), per PHP |
| Affected | PHP before 8.2.36, 8.3.0 to 8.3.36, 8.4.0 to 8.4.27, 8.5.0 to 8.5.12 |
| Fixed in | 8.2.36, 8.3.37, 8.4.28 and 8.5.13 (November 19, 2026) |
| Since | PHP 5.2.0 for URLs and PHP 4.3.0 for redirects, per the advisory |
PHP notes that those origin versions come from reviewing the code, not from testing releases that old.
I reproduced it: this is what an HTTPS that doesn't encrypt looks like
To check it, I set up two Docker containers with the official PHP images, php:8.3.36-cli (vulnerable) and php:8.3.37-cli (fixed), and a third container with a very simple server that listens on port 8443 without TLS and prints the first bytes it receives.
From PHP I sent the same POST three times, with a test token and password, changing only how the scheme is written:
<?php
foreach (['https://', 'HTTPS://', 'httpS://'] as $scheme) {
$ctx = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Authorization: Bearer SECRET123\r\n" .
"Content-Type: application/x-www-form-urlencoded",
'content' => 'password=supersecret',
'timeout' => 3,
],
]);
$r = @file_get_contents($scheme . 'srv:8443/api', false, $ctx);
echo PHP_VERSION, " $scheme -> ", var_export($r, true), "\n";
}
With lowercase https://, both versions do the right thing: the first thing the server receives is the TLS handshake (bytes 16 03 01, unreadable), and since the server does not speak TLS, the request fails.
With PHP 8.3.36 and HTTPS:// or httpS://, this is what reached the server, as is:
POST /api HTTP/1.1
Host: srv:8443
Connection: close
Content-Length: 20
Authorization: Bearer SECRET123
Content-Type: application/x-www-form-urlencoded
password=supersecret
The token and the password, readable. And PHP returned the server's response as if nothing had happened: the program has no way of knowing the connection was not encrypted.
With PHP 8.3.37, all three variants send the TLS handshake. I also tried the PHP 8.6.0 image, the new version released on the same November 19, and it already ships fixed.
The sneakiest case: redirects
You might think: "I always write https:// in lowercase, this doesn't affect me." PHP's advisory explains why that is not enough.
By default, file_get_contents() follows redirects. If the server you call, or someone who got in the middle, answers with a redirect to HTTPS:// in uppercase, PHP follows it unencrypted. And if it is a 307 redirect, which requires repeating the request as is, PHP resends the POST body.
I tested that too: I set up a server with real TLS that answers everything with a 307 to HTTPS://srv:8443/stolen. My code called https://, written correctly. With PHP 8.3.36, this reached the server unencrypted:
POST /stolen HTTP/1.1
Host: srv:8443
Connection: close
Content-Length: 20
Content-Type: application/x-www-form-urlencoded
password=supersecret
In my test the Authorization header was not resent, but the form data was. The advisory talks about "retained" authentication headers, meaning the ones PHP keeps when following the redirect. With PHP 8.3.37 the redirect is attempted over TLS, as it should be.
How serious is it in practice
To steal anything, an attacker needs two things:
- To be able to see the traffic between your server and the destination: be on the same network, at an intermediate point, or on a Wi-Fi network if the PHP runs on a laptop. Not just anyone on the internet can do that, and it is what keeps the score from going above 8.2.
- For the URL to arrive with the S in uppercase. That happens three ways: a developer wrote it that way, the URL comes from outside (a form, a database, a config file, a webhook the customer sets up), or a redirect.
The second one is what worries me most. Any application that lets a user or customer type in their server's URL (for a webhook, an integration or a feed) can receive HTTPS:// without anyone meaning harm: plenty of programs and phone keyboards capitalize the start of a field automatically.
What about WordPress?
WordPress's own functions for requesting URLs (wp_remote_get(), wp_remote_post() and the rest) are not affected. I checked the code of the library they use internally (Requests): it lowercases the scheme before deciding, and it normally sends the request with cURL, which does not have this problem. I tested that as well: on PHP 8.3.36, cURL with HTTPS:// sends the TLS handshake.
The risk is in plugins and themes that use file_get_contents() or fopen() on URLs instead of the WordPress functions, and there are quite a few. The same goes for Laravel, Symfony or custom code: it depends on which function each part uses.
What to do
1. Update PHP
It is the only full fix. Check which version your website runs, not just the one in your terminal: many servers have several side by side.
php -v
php-fpm8.3 -v
Replace 8.3 with your version. You need at least 8.2.36, 8.3.37, 8.4.28 or 8.5.13. If your site is on shared hosting, the control panel usually has a PHP version section; if none of those versions shows up, ask your provider.
A note on Linux distributions: some, like Ubuntu in its official packages, usually backport patches to their own version without changing the number, so an 8.3.6 may or may not be fixed. Debian, on the other hand, moved bookworm straight to 8.2.36-1~deb12u1 (DSA-6641-1). If you use your distribution's packages, check its security advisory for this CVE, not just the number.
And if you are still on PHP 8.1 or older: that branch reached end of life on December 31, 2025, according to php.net, and did not get this patch. 8.2 ends on December 31, 2026, a month from now.
After updating, restart PHP-FPM or Apache so the change takes effect:
sudo systemctl restart php8.3-fpm
2. If you cannot update yet
PHP's advisory itself gives two measures.
Lowercase the scheme before passing the URL to any file function. A small function is enough. I tested it on PHP 8.3.36 and, with it, HTTPS:// does get encrypted:
function safe_url(string $url): string {
return preg_replace_callback(
'#^[a-z][a-z0-9+.-]*://#i',
fn($m) => strtolower($m[0]),
$url
);
}
$data = file_get_contents(safe_url($customer_url));
It only changes the scheme: the rest of the URL stays the same, because case does matter in the path.
Do not follow redirects blindly. Normalizing your URL does not protect you from the redirect. If you send sensitive data, turn them off and decide what to do with each one yourself:
$ctx = stream_context_create([
'http' => [
'follow_location' => 0,
],
]);
In my test on 8.3.36, with that option the redirecting server received nothing unencrypted.
The cleaner alternative is to move that code to cURL, which handles the scheme correctly and has been the recommended way to call APIs from PHP for years.
3. Find exposed code
If you maintain PHP code, these two searches give you a quick picture. The first finds URLs written with an uppercase S:
grep -rnE "['\"][Hh][Tt][Tt][Pp]S://|['\"][Ff][Tt][Pp]S://" --include=*.php .
The second finds calls to URLs with the affected functions, so you can review them by hand:
grep -rniE "(file_get_contents|fopen|file|copy)\(\s*['\"]?(\\\$|https?://|ftps?://)" --include=*.php . | head -50
The second one gives quite a few false positives, because it also finds reads of local files. What you are looking for are the ones that receive a URL coming from outside.
It is not the only flaw in this update
The November 19 releases fix much more than this. According to PHP's changelog, 8.3.37 includes thirteen security fixes, among them:
- Two session flaws that can lead to remote code execution (CVE-2026-126714 and CVE-2026-115560).
- A flaw in the timezone cache that can also lead to remote code execution (CVE-2026-129496).
- In PHP-FPM, which is how most nginx servers run PHP: a request smuggling vulnerability (CVE-2026-129289), a local privilege escalation (CVE-2026-129291) and an XSS on the status page (CVE-2026-129292).
- A way to bypass signature verification on PHAR files (CVE-2026-128090).
8.2.36 has almost the same list. The capital-S flaw is the easiest one to understand, but it is not the most dangerous in this batch.
Summary
- Until November 19, in PHP,
HTTPS://with the S in uppercase traveled unencrypted throughfile_get_contents(),fopen()and similar functions. Also when following redirects. - Update to 8.2.36, 8.3.37, 8.4.28 or 8.5.13 (or your distribution's fixed package) and restart PHP-FPM.
- If you cannot yet: lowercase the scheme, turn off
follow_locationwhen sending sensitive data, or use cURL. - WordPress is not affected in its own functions, but any plugin that calls URLs with
file_get_contents()can be.
Sources
- PHP: advisory GHSA-f6gg-rchx-xw8j (CVE-2026-128064)
- PHP: PHP 8 changelog
- PHP: supported versions and unsupported versions
- Debian: CVE-2026-128064
- Official Docker images
php:8.3.36-cli,php:8.3.37-cliandphp:8.6-cli, tested on November 25, 2026