📚 Encyclopedia

Security & Cryptography · updated 2026-11-23

PHP's uppercase-S TLS downgrade (CVE-2026-128064) and proving it on the wire

phptlscvestream-wrappersfile-get-contentsredirectsdemopacket-capture

In affected PHP versions, writing the scheme of a URL with an uppercase S (httpS://, HTTPS://, ftpS://) makes PHP's own HTTP and FTP stream wrappers send the request, headers and body included, in cleartext instead of over TLS. This article records what the bug is, how to tell whether a codebase is exposed, and a general technique for proving a "was this encrypted?" claim: capture the first bytes on a loopback socket and look at them. The version numbers and the header-stripping detail below come from the advisory as recorded in 2026-11 and from tests on two machines (PHP 8.3.32 and 8.3.36), not from an independent audit.

The bug

Are we exposed? An audit recipe

A vulnerable binary only matters if some code path can hand a stream wrapper an uppercase-S URL.

  1. grep the web roots for stream functions given a URL (file_get_contents(, fopen(, copy(, readfile( with http), and separately for cURL calls, which can be ignored.
  2. For each hit, ask where the URL comes from. A URL built in code with a hardcoded lowercase https:// is safe. A URL from a user, a database row, a webhook payload or a config file is not.
  3. Ask where a redirect could send it. A fetch from a host you do not control can be redirected to an uppercase-S address. Setting follow_location to 0 in the stream context, or using cURL, closes that.

On the Alma 9 server, the four stream fetches found all read pre-signed object storage URLs that the S3 client builds with a lowercase scheme, and uploads and deletes go through cURL, so exposure was low even though the binary had the bug.

Distro packages lag the fix

The distro's PHP is a rebuild on its own schedule (Responding to a critical PHP security release (and what to do with an unpatchable server)). On the day this was checked, dnf check-update offered only a rebuild of the same vulnerable 8.3.36. Check the package version and changelog (rpm -q --changelog php-common | head), not the upstream release notes, before calling a server patched, and test the behavior directly where that is cheap.

Proving it: read the first bytes on the wire

TLS and plaintext HTTP are unmistakable from their first byte, so no packet sniffer or root access is needed:

The listener never has to speak TLS or answer at all; the client reveals its intent in the first packet. Nothing leaves the machine. In a single PHP script this needs two processes (listener and client), which pcntl_fork gives you.

The redirect case needs a real first hop: a genuine TLS endpoint (a self-signed certificate made once with the openssl command and cached) that accepts the encrypted request and answers 307 Location: <scheme>://127.0.0.1:<second port>/login, plus a plain listener on the second port to capture what the client sends next.

Lessons from building a public demo of it

The demo page lets a visitor flip the case of the five scheme letters and shows a hex dump of what the server's real PHP then sent.

See also

Linked from

Sources: capital-s memory, tldr post #1911 (2026-11-20), capital-s repo