DEV Community

Cover image for PHP uppercase HTTPS:// URLs skip TLS: CVE-2026-128064
proxymint
proxymint

Posted on Originally published at proxymint.com

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

Originally published on proxymint.

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.

TL;DR

  • 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.
  • 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.
  • 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.
  • 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.

Key takeaways

  • Grep for the exact spellings. Only a capital S in the fifth position (HTTP) or fourth (FTP) skips TLS, so Https:// is fine and hTTPS:// isn't.
  • Expect port 80, not just plaintext. With no port in the URL, an affected build sends HTTPS://host/ to port 80.
  • Lowercase the scheme where URLs enter your code. That covers user input, config and crawled pages. Until you've upgraded, check each redirect hop yourself as well.
  • Test the binary that serves traffic. The host CLI, PHP-FPM and the PHP inside your image can be three different builds.

Read the full guide on proxymint, with the commands, tables and sources.

Top comments (0)