Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-91769 Overview
CVE-2026-91769 is an improper certificate validation flaw [CWE-297] in PHP's OpenSSL stream wrapper. When verifying a TLS peer, PHP checks the certificate's subjectAltName (SAN) entries first. If no SAN entry matches, PHP incorrectly falls back to the Common Name (CN). RFC 6125 requires implementations to ignore the CN once any service identity SAN is present. As a result, a certificate carrying a non-matching DNS SAN is still accepted when its CN matches the requested peer_name. An attacker holding a certificate trusted by the client for one hostname can impersonate another.
Critical Impact
A valid certificate issued for one hostname can be reused to impersonate a different hostname over TLS, breaking the confidentiality guarantees of PHP applications that rely on OpenSSL stream peer verification.
Affected Products
- PHP (php-src) OpenSSL stream wrapper
- PHP applications using stream_context with verify_peer_name and OpenSSL-backed streams
- See the GitHub Security Advisory for version-specific fix information
Discovery Timeline
- 2026-09-25 - CVE-2026-91769 published to NVD
- 2026-09-29 - Last updated in NVD database
Technical Details for CVE-2026-91769
Vulnerability Analysis
The flaw sits in PHP's hostname verification path for TLS streams. When PHP compares the requested peer_name against the server certificate, it iterates the DNS entries in the subjectAltName extension. If none of the SAN entries match, the code falls through to compare peer_name against the certificate's Common Name. RFC 6125 explicitly prohibits this fallback whenever any service identity is present in the SAN. The attack surface requires network adjacency to intercept or redirect traffic, so remote exploitation across the open internet is limited to attackers who can position themselves on the path.
Root Cause
The root cause is non-conformance with RFC 6125 Section 6.4.4 in PHP's peer verification routine. Modern certificate verification must treat SAN as authoritative: if SAN is present, the CN must be ignored entirely. PHP instead treats CN as a secondary matching source, reintroducing legacy behavior that was deprecated to prevent cross-identity impersonation using CA-issued certificates.
Attack Vector
An attacker on an adjacent network who can intercept or redirect TLS traffic presents a certificate that was legitimately issued for a hostname the attacker controls. The certificate's CN is set to the victim target (for example, the requested peer_name), while its SAN lists only the attacker's own hostnames. PHP's verification matches the CN and accepts the connection, allowing the attacker to impersonate the target service and read or modify application traffic.
No verified public exploit code is available. See the GitHub Security Advisory for the maintainers' technical description.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-91769
Indicators of Compromise
- TLS sessions where the negotiated server certificate's SAN entries do not contain the hostname the PHP application requested in peer_name
- Certificates presented to PHP clients whose CN matches an internal service while SAN lists unrelated external domains
- Unexpected certificate issuers or short-lived certificates appearing on connections to internal services
Detection Strategies
- Instrument outbound TLS connections from PHP services and log the full server certificate chain, including SAN and CN fields, for offline comparison against expected values
- Deploy TLS inspection or passive capture at egress to flag mismatches between requested hostnames and presented certificate SAN entries
- Audit PHP code for stream contexts that enable verify_peer but rely on default verify_peer_name behavior against untrusted networks
Monitoring Recommendations
- Alert on PHP processes connecting to hostnames whose certificates lack a matching SAN entry
- Monitor for anomalous certificate authorities issuing certificates for internal service names
- Track upgrades of the PHP runtime across production fleets to confirm patched versions are deployed
How to Mitigate CVE-2026-91769
Immediate Actions Required
- Upgrade PHP to a release that includes the fix published in the GitHub Security Advisory GHSA-vvx9-73fr-5jjx
- Inventory PHP applications that initiate outbound TLS connections using stream_socket_client, fsockopen, file_get_contents with HTTPS, or SOAP and database clients that rely on OpenSSL streams
- Restrict outbound connections from PHP workloads to known destinations to reduce opportunities for adjacent-network interception
Patch Information
The PHP maintainers published a security advisory tracked as GHSA-vvx9-73fr-5jjx. Refer to the upstream advisory for the exact fixed versions across supported PHP branches and apply vendor-supplied packages as they become available for your distribution.
Workarounds
- Pin expected certificates by setting the peer_fingerprint option in the SSL stream context so verification does not rely on hostname matching alone
- Use a dedicated certificate authority for internal services and enforce certificate pinning in reverse proxies that terminate TLS on behalf of PHP applications
- Where feasible, route PHP outbound TLS through a hardened proxy that performs RFC 6125 compliant hostname verification
# Example: pin an expected certificate fingerprint in a PHP stream context
# so hostname verification bugs cannot be used to impersonate the peer.
php -r '
$ctx = stream_context_create([
"ssl" => [
"verify_peer" => true,
"verify_peer_name" => true,
"peer_name" => "api.example.internal",
"peer_fingerprint" => ["sha256" => "<expected-sha256-fingerprint>"],
],
]);
$fp = stream_socket_client("ssl://api.example.internal:443", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $ctx);
'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

