HSEC-2026-0016

See a problem?
Import Source
https://github.com/haskell/security-advisories/blob/generated/osv-export/2026/HSEC-2026-0016.json
JSON Data
https://api.osv.dev/v1/vulns/HSEC-2026-0016
Published
2026-11-17T09:58:05Z
Modified
2026-11-17T10:00:02Z
Summary
Improper IP address validation in validateCertificateName
Details

Improper IP address validation in validateCertificateName

Data.X509.Validation.getNames extracts only AltNameDNS entries from the subjectAltName extension (Data/X509/Validation.hs, unAltName, ~L512–515 in crypton-x509-validation 1.10.1). When a certificate carries an iPAddress SAN but no dNSName SAN, the extracted name list is empty, so validateNames (~L569–580) falls through to the commonName branch as if no SAN extension existed, even though the extension's haddock promises that the commonName is ignored whenever subjectAltName is present. Consequently, when a client connects to an IP literal:

  • a certificate with CN = <target IP> but iPAddress SAN pointing to a different host is accepted;
  • a certificate whose only valid identity is a matching iPAddress SAN is rejected.

Exploitation requires a certificate from a CA the client trusts that has a commonName different from its iPAddress SAN (public CAs are barred from this by the CA/Browser Forum Baseline Requirements, but private or enterprise CAs can issue such certificates). A successful impersonation exposes and can modify the protected connection.

The draft fix makes getNames distinguish "no SAN extension" from "SAN extension present with no DNS names" and applies SAN semantics (including the existing iPAddress comparison) whenever the extension is present, restoring the documented SAN-supersedes-CN behavior in line with RFC 9525. No fixed release is published at the time of writing (1.10.1 is the latest release and still vulnerable).

Credits

Reported by Dickson Wu (SEAL & CertiK). Validated and fixed by Kazu Yamamoto.

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

Affected packages

Hackage / crypton-x509-validation

Package

Name
crypton-x509-validation
Purl
pkg:hackage/crypton-x509-validation

Severity

  • 7.4 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N CVSS Calculator

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.6.12
Fixed
1.10.2

Affected versions

1.*
1.6.12
1.6.13
1.6.14
1.8.0
1.9.0
1.9.1
1.10.0
1.10.1

Ecosystem specific

{
    "affected_api":  [
        {
            "module":  "Data.X509.Validation",
            "name":  "validateCertificateName"
        },
        {
            "module":  "Data.X509.Validation",
            "name":  "validateDefault"
        }
    ]
}

Database specific

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"
source
"https://github.com/haskell/security-advisories/blob/generated/osv-export/2026/HSEC-2026-0016.json"