CVE-2026-91767
Information disclosure via crafted TLS server certificate
| Publication Date | 2026-09-25 |
|---|---|
| Severity | Moderate |
| Type | Information Disclosure |
| Affected PHP Versions |
|
| Fixed Product Versions |
|
CVE Details
php_openssl_matches_wildcard_name() in ext/openssl/xp_ssl.c underflows the length argument passed to memchr() when a TLS server certificate presents a wildcard name whose literal characters are together longer than the hostname being verified. A malicious server presenting such a certificate makes the PHP client read up to SIZE_MAX bytes past the end of a heap allocation. The path is reachable from any default client stream, because verify_peer_name is enabled by default. A malicious server presenting a specially crafted certificate can exploit this issue against a connecting PHP client. This flaw primarily leads to information disclosure, potentially exposing sensitive data stored in application memory.
Recommendations
Consider using cURL instead of the HTTP stream wrapper when making web requests via PHP. If you cannot, consider disabling the verify_peer_name setting in the stream context:
$context = stream_context_create([
'ssl' => [
'verify_peer_name' => false,
],
'http' => [
'follow_location' => 0,
],
]);
$body = file_get_contents($url, false, $context);
We recommend updating to a patched version of PHP if you use the HTTP stream wrapper to make requests to servers using TLS.