2026-09-25 20:59CVE-2026-91769php
PUBLISHED5.2CWE-297

TLS Hostname Verification Falls Back to CN After SAN Mismatch

PHP's OpenSSL stream peer verification checks the certificate's subjectAltName entries first and, whenever no entry matches, falls back to the Common Name. RFC 6125 requires the CN to be ignored once the certificate presents any service identity, so a certificate carrying a non-matching DNS SAN was still accepted when its CN matched the requested peer_name. A certificate trusted by the client for one name can therefore be used to impersonate another.

Problem type

Affected products

PHP Group

PHP

< 8.2.34 - AFFECTED

< 8.3.35 - AFFECTED

< 8.4.26 - AFFECTED

< 8.5.11 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-91769
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-91769",
    "assignerOrgId": "dd77f84a-d19a-4638-8c3d-a322d820ed2b",
    "assignerShortName": "php",
    "dateUpdated": "2026-09-25T20:59:39.727Z",
    "dateReserved": "2026-09-15T00:44:10.816Z",
    "datePublished": "2026-09-25T20:59:39.727Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "dd77f84a-d19a-4638-8c3d-a322d820ed2b",
        "shortName": "php",
        "dateUpdated": "2026-09-25T20:59:39.727Z"
      },
      "title": "TLS Hostname Verification Falls Back to CN After SAN Mismatch",
      "descriptions": [
        {
          "lang": "en",
          "value": "PHP's OpenSSL stream peer verification checks the certificate's subjectAltName entries first and, whenever no entry matches, falls back to the Common Name. RFC 6125 requires the CN to be ignored once the certificate presents any service identity, so a certificate carrying a non-matching DNS SAN was still accepted when its CN matched the requested peer_name. A certificate trusted by the client for one name can therefore be used to impersonate another.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "<p>PHP's OpenSSL stream peer verification checks the certificate's subjectAltName entries first and, whenever no entry matches, falls back to the Common Name. RFC 6125 requires the CN to be ignored once the certificate presents any service identity, so a certificate carrying a non-matching DNS SAN was still accepted when its CN matched the requested <code>peer_name</code>. A certificate trusted by the client for one name can therefore be used to impersonate another.</p>"
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "PHP Group",
          "product": "PHP",
          "packageName": "ext-openssl",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "8.2.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.2.34"
            },
            {
              "version": "8.3.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.3.35"
            },
            {
              "version": "8.4.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.4.26"
            },
            {
              "version": "8.5.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.5.11"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-297 Improper validation of certificate with host mismatch",
              "cweId": "CWE-297",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/php/php-src/security/advisories/GHSA-vvx9-73fr-5jjx",
          "tags": [
            "vendor-advisory"
          ]
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-94",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-94"
            }
          ]
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ],
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
            "attackVector": "ADJACENT_NETWORK",
            "attackComplexity": "LOW",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "LOW",
            "integrityImpact": "NONE",
            "availabilityImpact": "NONE",
            "baseScore": 4.3,
            "baseSeverity": "MEDIUM"
          }
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Cantina (https://www.cantina.security/)",
          "type": "reporter"
        },
        {
          "lang": "en",
          "value": "David Korczynski",
          "type": "reporter"
        },
        {
          "lang": "en",
          "value": "Jakub Zelenka",
          "type": "remediation developer"
        },
        {
          "lang": "en",
          "value": "Arnaud Le Blanc",
          "type": "remediation reviewer"
        },
        {
          "lang": "en",
          "value": "Alexandre Daubois",
          "type": "remediation reviewer"
        }
      ]
    }
  }
}