PHP uppercase HTTPS:// URLs skip TLS: CVE-2026-128064

CVE-2026-128064: PHP sends HTTPS:// and FTPS:// URLs with an uppercase S in plaintext. Test your build in 30 seconds, check versions, grep your code.

Night voxel scene with the proxymint logo and the headline: PHP uppercase HTTPS:// URLs skip TLS: CVE-2026-128064
Quick summary · TL;DR
  1. Run the 30-second nc test before reading anything else. Listen with nc -l 8443 in one terminal and run php -r 'file_get_contents("HTTPS://127.0.0.1:8443/");' in another. A readable GET / HTTP/1.1 in the listener means your build skips TLS.
  2. Patch to 8.2.36, 8.3.37, 8.4.28 or 8.5.13, all released on 19 November. PHP 8.1 got no release and stays affected, so on 8.1 the real fix is a newer branch or a distro backport.
  3. Don't trust php -v alone on a distro. Ubuntu 22.04 reports 8.1.2 and is patched, while a php:8.1 Docker image reports 8.1.34 and isn't.
  4. Lowercase URLs in your own code don't protect redirects. A 307 to HTTPS:// resends the POST body and auth headers in cleartext. Where requests carry secrets, set follow_location to 0.

Any PHP before 8.2.36, 8.3.37, 8.4.28 or 8.5.13 sends a URL without TLS when its scheme ends in a capital S, as in HTTPS:// or FTPS://. That uppercase HTTPS bug is CVE-2026-128064, fixed on 19 November 2026. It hits file_get_contents(), fopen() and the other stream functions, and redirect targets too.

Upgrade first. After that, three checks take about five minutes in all:

  • watch what your build really sends, with a local listener
  • check the version, including images and distro packages
  • grep for the spellings that trigger it

What the uppercase HTTPS bug does

The PHP advisory GHSA-f6gg-rchx-xw8j, published on 19 November 2026, comes down to two checks that disagree. PHP’s HTTP and FTP stream wrappers accept a scheme in any case, so HTTPS://example.com/ is a valid URL to them. TLS, though, is switched on by a separate check, and that one looks for a lowercase s at one fixed position.

You can see it in the source. In PHP 8.4.27 the HTTP wrapper tests the fifth character of the scheme, and the FTP wrapper tests the fourth. PHP 8.4.28 compares the whole scheme with “https”, ignoring case.

Two details from that code are easy to miss:

  • Only one letter counts. Https:// and HTTPs:// still get TLS. HTTPS://, httpS:// and hTTPS:// don’t, though every one of them reads as HTTPS in a code review.
  • Port 80 replaces 443. One flag picks both TLS and the default port, so HTTPS://api.example.com/ with no port goes to port 80 in plaintext.

Per the advisory, whatever the request carried can leak. That includes Basic auth credentials, bearer tokens, cookies, POST data, FTP logins and file contents. An attacker has to be able to see the traffic.

Redirects are the nastier path

Your code can use lowercase everywhere and still hit this. In the advisory’s example, a valid HTTPS connection answers with a 307 pointing at an uppercase HTTPS:// URL. PHP follows it and resends the preserved POST body and any retained auth headers in cleartext. So the data is gone before the destination gets the chance to refuse the plaintext connection.

A 307 keeps the method and body by design (RFC 9110, section 15.4.8, June 2022), so the body goes along. And the bug is old. By the advisory’s code inspection, mixed-case URLs have been affected since PHP 5.2.0 and redirects since PHP 4.3.0.

CVE-2026-128064 severity

SourceScoreWhy it differs
PHP, in the CVE recordCVSS 4.0 8.2, HighLow attack complexity, attack requirements present
Red HatCVSS 3.1 5.9, ImportantScores attack complexity as high
Amazon LinuxCVSS 3.1 5.9, MediumSame vector as Red Hat

PHP rates attack complexity low with attack requirements present, while Red Hat and Amazon rate it high. Both readings lead to the same action, and the weakness is filed as CWE-319, cleartext transmission of sensitive information.

Which PHP versions fix CVE-2026-128064

BranchAffectedFixed on 19 Nov 2026
8.1 and olderAll versionsNo release. 8.1 reached end of life on 31 Dec 2025
8.2Before 8.2.368.2.36
8.38.3.0 to 8.3.368.3.37
8.48.4.0 to 8.4.278.4.28
8.58.5.0 to 8.5.128.5.13
8.6None8.6.0 ships with the fix

All four fixes are listed in the PHP 8 ChangeLog. Since the advisory’s first range is ”< 8.2.36”, 8.1 and everything before it stays affected. php.net’s end-of-life page lists 8.1.34 as the last 8.1 release, and the supported versions page gives 8.2 security fixes until 31 December 2026.

Check your setup for CVE-2026-128064

1. Watch what your build sends

Open two terminals. In the first, start a listener:

nc -l 8443        # macOS, BSD and OpenBSD netcat
nc -l -p 8443     # traditional netcat on some Linux builds

In the second, fetch it with an uppercase scheme:

php -r 'file_get_contents("HTTPS://127.0.0.1:8443/");'

If nc prints a readable request that starts with GET / HTTP/1.1 and a Host: 127.0.0.1:8443 line, that build sent an HTTPS URL in plaintext and is affected. PHP 7 and older send HTTP/1.0 there, per the HTTP context docs. On a fixed build PHP starts a TLS handshake instead, so nc shows a few bytes of binary noise (the ClientHello). Either way PHP then waits for a reply, so stop both with Ctrl-C.

Run it with the PHP that actually serves traffic. Your host’s CLI isn’t always the PHP-FPM build or the one inside your container. For a container, run the same line with docker exec and point it at an address where nc is listening.

2. Check the version, then the package

php -v against the table is the quick part. For images, docker run --rm IMAGE php -v takes seconds. Docker Hub had official tags for 8.2.36, 8.3.37, 8.4.28 and 8.5.13 by 20 November, while the newest 8.1 tag is still 8.1.34, so a php:8.1 base stays affected. Rebuilding on a floating tag like php:8.4 only helps once you pull it again.

Distro packages are where php -v misleads, in both directions, because distros backport fixes.

DistroStatus, checked 21 Nov 2026
Debian 12 bookwormphp8.2 fixed in 8.2.36-1~deb12u1 (DLA-4916-1)
Debian 13 trixiephp8.4 fixed in 8.4.28-1~deb13u1 (DSA-6641-1). Testing (forky) is still on vulnerable 8.4.27-1
Ubuntu 14.04, 16.04, 18.04, 20.04Fixed in Ubuntu Pro (ESM) packages; 14.04 and 16.04 need the Legacy Support add-on
Ubuntu 22.04php8.1 fixed in 8.1.2-1ubuntu2.29, though upstream 8.1 got nothing
Ubuntu 24.04php8.3 fixed in 8.3.6-0ubuntu0.24.04.14
Ubuntu 26.04php8.5 fixed in 8.5.4-0ubuntu1.6
RHEL 10php8.4 fixed in 8.4.28-1.el10_3 (RHSA-2026:100821, 20 Nov). The default php package is still listed as affected
RHEL 7 to 9Listed as affected, no fix yet
Amazon Linux 2023php8.2 to 8.5 fixed, php8.1 “No Fix Planned”
Amazon Linux 2php8.2 extra fixed, core php “No Fix Planned”

Sources: the Debian tracker, the Ubuntu CVE page, Red Hat and Amazon Linux as linked above. Compare dpkg -l 'php*' or rpm -qa 'php*' with the tracker for your release.

3. Grep for the spellings that trigger it

grep -rnE "[Hh][Tt][Tt][Pp]S://|[Ff][Tt][Pp]S://" --include=*.php .

That pattern catches every spelling with the S capitalised where PHP looks, and skips the safe ones like Https://. Run it again without --include over config files and .env. Then look at what grep can’t see: URLs that come from user input, a database, webhook settings or crawled pages, and every place that follows redirects. file_get_contents() follows them by default, up to 20.

Fix it, or work around it

Upgrade to the fixed release for your branch, then restart PHP-FPM and any long-running workers so they load the new binary. If you can’t patch today, the advisory gives the workaround. Lowercase the scheme before any stream call, turn off automatic redirects, and check every redirect target yourself.

function lower_scheme(string $url): string {
    return preg_replace_callback('~^[a-z][a-z0-9+.-]*(?=://)~i',
        fn ($m) => strtolower($m[0]), $url);
}

$ctx = stream_context_create(['http' => ['follow_location' => 0]]);
$body = file_get_contents(lower_scheme($url), false, $ctx);

With follow_location set to 0, a redirect comes back to you instead of being followed. Read its Location header with http_get_last_response_headers() on PHP 8.4 and later ($http_response_header before that), check the host you expect, lowercase the scheme and request it yourself.

Scope: stream wrappers, not curl

This advisory covers the stream wrappers. PHP’s curl extension sends through libcurl, not through them, the setup covered in the PHP cURL proxy guide. Guzzle uses cURL by default when it’s available, per its FAQ, and can also send through PHP’s stream wrapper, so check which handler your install runs.

Crawlers need the closest look

A PHP crawler fetches URLs that someone else wrote. Page authors pick the case of every href, and servers pick every redirect. If those go straight into file_get_contents() along with a session cookie or an API token, this bug decides whether that header travels encrypted. Normalise the scheme where URLs enter the queue, run redirects through the same check, and write both into your web scraping architecture.

This is a client-side bug in PHP. Your PHP build and your URL handling are where the fix lives, whichever network the crawler’s traffic leaves through, rotating residential proxies included.

What to do now

Upgrade to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0, or to your distro’s fixed package, and restart. That closes CVE-2026-128064 for that build. On 8.1, move to a supported branch or a distro package that carries the backport. Run the nc test with the binary that serves traffic, grep for the affected spellings, and until you’re patched, turn off automatic redirects on any request that carries credentials.

Frequently asked questions

It's a PHP bug that makes the HTTP and FTP stream wrappers send HTTPS:// or FTPS:// URLs without TLS when the S in the scheme is uppercase. The wrappers take the scheme in any case, but the encryption decision rests on a single lowercase letter. PHP published it as GHSA-f6gg-rchx-xw8j on 19 November 2026 and rated it CVSS 4.0 8.2 High.

PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13, all released on 19 November 2026. PHP 8.6.0 came out the same day with the fix included. A distro package can carry the fix under an older version number, so the distro's tracker is the place to check.

Yes, and there is no new 8.1 release. The advisory's range is every version before 8.2.36, and 8.1 reached end of life on 31 December 2025. Some distros backported the fix anyway. Ubuntu 22.04's php8.1 package 8.1.2-1ubuntu2.29 carries it, while Amazon Linux 2023 lists php8.1 as no fix planned.

The advisory covers PHP's HTTP and FTP stream wrappers, and the curl extension sends through libcurl instead of them. Guzzle can go either way. It uses cURL by default when it is available and can also use PHP's stream wrapper, so check which handler your install runs.

Point an uppercase URL at a local listener and read what arrives. Start nc -l 8443 (nc -l -p 8443 on some Linux netcat builds), then run php -r with file_get_contents on HTTPS://127.0.0.1:8443/. A readable GET / HTTP/1.1 request in nc means the build is affected, while a fixed build sends binary TLS handshake bytes instead.

Set the stream context option follow_location to 0, so PHP hands redirects back to you instead of following them. Then read the Location header, check the host, lowercase the scheme and request it yourself. Lowercasing only the first URL does not cover redirects.

Because the URL often comes from somewhere else, such as user input, config, a webhook setting, a crawled page or a server's redirect. Schemes are case-insensitive by spec, so an application's own HTTPS check can accept HTTPS:// and pass it on. On an affected build that request then goes out in plaintext, and to port 80 if no port is given.

Researched and drafted with AI tools, then checked against our publishing rules before it went live: 15 outside links, 3 links to other proxymint pages, no prices and a fact-check pass against our product records. How we write.