REDHAT-BUG-2541652: Medium severity PHP PHP vulnerability
phpopensslmatcheswildcardname() in ext/openssl/xpssl.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 SIZEMAX bytes past the end of a heap allocation. The path is reachable from any default client stream, because verifypeername is enabled by default.
Affected Software
Event History
Frequently Asked Questions
Which PHP deployments are exposed to this issue?
PHP clients that use default client streams are exposed because peer-name verification is enabled by default. The vulnerable path is reached while verifying a TLS server certificate hostname.
What does an attacker need to exploit the flaw?
An attacker needs to operate or impersonate a TLS server that presents a certificate containing a wildcard name whose literal characters are longer than the hostname the PHP client is verifying. This causes an underflow in the length supplied to memchr().
What is the likely impact on a vulnerable client?
The PHP client can read beyond the end of a heap allocation, potentially attempting to read up to SIZE_MAX bytes past that allocation. The provided information does not specify further impact such as disclosure, crash behavior, or code execution.