{"id":"HSEC-2026-0016","summary":"Improper IP address validation in validateCertificateName","details":"# Improper IP address validation in validateCertificateName\n\n`Data.X509.Validation.getNames` extracts only `AltNameDNS` entries from the\nsubjectAltName extension (Data/X509/Validation.hs, `unAltName`,\n~L512–515 in crypton-x509-validation 1.10.1). When a certificate carries an\n`iPAddress` SAN but no `dNSName` SAN, the extracted name list is empty, so\n`validateNames` (~L569–580) falls through to the commonName branch as if no\nSAN extension existed, even though the extension's haddock promises that the\ncommonName is ignored whenever subjectAltName is present. Consequently, when\na client connects to an IP literal:\n\n* a certificate with `CN = \u003ctarget IP\u003e` but `iPAddress` SAN pointing to a\n  different host is **accepted**;\n* a certificate whose only valid identity is a matching `iPAddress` SAN is\n  **rejected**.\n\nExploitation requires a certificate from a CA the client trusts that has a\ncommonName different from its iPAddress SAN (public CAs are barred from this\nby the CA/Browser Forum Baseline Requirements, but private or enterprise\nCAs can issue such certificates). A successful impersonation exposes and can\nmodify the protected connection.\n\nThe draft fix makes `getNames` distinguish \"no SAN extension\" from \"SAN\nextension present with no DNS names\" and applies SAN semantics (including\nthe existing iPAddress comparison) whenever the extension is present,\nrestoring the documented SAN-supersedes-CN behavior in line with RFC 9525.\nNo fixed release is published at the time of writing (1.10.1 is the latest\nrelease and still vulnerable).\n\n## Credits\n\nReported by Dickson Wu (SEAL & CertiK). Validated and fixed by Kazu Yamamoto.\n","modified":"2026-11-17T10:00:02.837353897Z","published":"2026-11-17T09:58:05Z","database_specific":{"home":"https://github.com/haskell/security-advisories","osvs":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export","repository":"https://github.com/haskell/security-advisories"},"references":[{"type":"PACKAGE","url":"https://hackage.haskell.org/package/crypton-x509-validation"},{"type":"FIX","url":"https://github.com/kazu-yamamoto/crypton-certificate/commit/d2f64137954b4026332fa9f08c1711bd92c79d62"},{"type":"FIX","url":"https://github.com/kazu-yamamoto/crypton-certificate/commit/d782c2dd83e69d2ed103ed42fdac95d94262e7d3"}],"affected":[{"package":{"name":"crypton-x509-validation","ecosystem":"Hackage","purl":"pkg:hackage/crypton-x509-validation"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.6.12"},{"fixed":"1.10.2"}]}],"versions":["1.10.0","1.10.1","1.6.12","1.6.13","1.6.14","1.8.0","1.9.0","1.9.1"],"ecosystem_specific":{"affected_api":[{"module":"Data.X509.Validation","name":"validateCertificateName"},{"module":"Data.X509.Validation","name":"validateDefault"}]},"database_specific":{"source":"https://github.com/haskell/security-advisories/blob/generated/osv-export/2026/HSEC-2026-0016.json","human_link":"https://github.com/haskell/security-advisories/tree/main/advisories/published/2026/HSEC-2026-0016.md","osv":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export/2026/HSEC-2026-0016.json"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"}]}],"schema_version":"1.9.2"}