CVE-2026-91767

Heap-buffer-overflow in php_openssl_matches_wildcard_name on crafted server cert wildcard CN

Published Sep 25, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

A heap buffer overflow occurs in PHP’s OpenSSL wrapper when the function php_openssl_matches_wildcard_name compares a wildcard certificate CN whose literal characters exceed the hostname being verified. The function underflows the length argument to memchr, causing PHP to read up to SIZE_MAX bytes past the end of a heap allocation, which can lead to an out‑of‑bounds read, memory corruption, and potentially arbitrary code execution or a crash of the PHP process.

Affected Systems

The vulnerability affects the PHP Group’s PHP implementation. No specific affected versions are listed in the advisory, so any installed PHP that has not yet been updated to the patched release is potentially vulnerable.

Risk and Exploitability

The CVSS score of 6.5 rates the issue as medium severity, and with no EPSS data available the likelihood of exploitation remains uncertain. The path is reachable from any default client stream, as peer name verification is enabled by default. An attacker who can control the server certificate presented to a PHP client can exploit this flaw from the client side, achieving code execution or denial of service if successful. The vulnerability is not listed in the CISA KEV catalog.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PHP to the latest supported release that includes the fix for the heap buffer overflow in ext/openssl/xp_ssl.c
  • If an upgrade is not immediately possible, configure PHP streams to disable peer name verification—for example, set the ssl.verify_peer_name option to false in the stream context used for external TLS connections
  • Validate that any external TLS certificates do not use wildcards whose literal length exceeds the hostname of the PHP client, and avoid connecting to such servers until the issue is resolved

Generated by OpenCVE AI on September 26, 2026 at 01:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4819-1 php8.2 security update
Debian DSA Debian DSA DSA-6514-1 php8.4 security update
Ubuntu USN Ubuntu USN USN-8936-1 PHP vulnerabilities
History
Type Values Removed Values Added
First Time appeared Php
Php php
CPEs cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
Vendors & Products Php
Php php
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Php Group
Php Group php
Vendors & Products Php Group
Php Group php
Type Values Removed Values Added
Description 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.
Title Heap-buffer-overflow in php_openssl_matches_wildcard_name on crafted server cert wildcard CN
Weaknesses CWE-122
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
php
Published
Updated
Sep 28, 2026, 1:31 PM
Reserved
Sep 15, 2026, 12:41 AM
Status
Analyzed
Published
Sep 25, 2026, 9:17 PM
Modified
Oct 27, 2026, 1:14 PM
Severity
Moderate
Public date
Sep 25, 2026, 8:53 PM