PHP’s HTTP and FTP stream wrappers can transmit data without TLS when an HTTPS or FTPS URL uses an uppercase “S,” such as HTTPS://, httpS://, or FTPS://. Although the wrappers accept schemes regardless of capitalization, their TLS check was case-sensitive, allowing a URL to pass an application’s case-insensitive security validation while using plain HTTP or FTP. Applications that access such URLs through functions including file_get_contents() or fopen() may expose credentials, tokens, cookies, request bodies, and transferred files to anyone able to observe the network connection. The issue also affects redirects: an HTTPS request redirected to a mixed-case HTTPS URL can resend a POST body and retained authentication headers without encryption.
The advisory rates the vulnerability High, with a CVSS score of 8.2, and identifies confidentiality as the principal impact; exploitation requires a relevant URL to reach a stream wrapper and an attacker to observe the traffic. Direct mixed-case URLs have been affected since PHP 5.2.0, while redirects to them have been affected since PHP 4.3.0, according to code inspection. Fixed releases are PHP 8.2.36, 8.3.37, 8.4.28, and 8.5.13. Until upgrading, applications should lowercase HTTPS and FTPS schemes before using stream functions. Where redirects are enabled, automatic following should be disabled and every redirect target validated and normalized; fixing only the initial URL does not prevent exposure through a redirect.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.