CVE-2026-103602 Bouncy Castle bc-csharp 证书校验不当漏洞
影响攻击者可绕过名称约束,使本应被排除的证书通过校验
Bouncy Castle 的 C# 版本 bc-csharp 在 PkixNameConstraintValidator 中存在证书校验不当问题。该组件在 PKIX 证书路径校验时,比较名称与约束前未去除 RFC 1034 根标签的尾部点号,导致完全限定主机名无法匹配同一主机不带点号的排除子树。攻击者可借此让本应被拒绝的证书通过校验。
影响范围
漏洞详情
漏洞类型为证书校验不当(名称约束绕过)。成因是校验逻辑未先剥离主机名末尾的点号,使带点与不带点的同一主机名被视为不同名称。当中间 CA 带有排除子树约束时,攻击者可用以点号结尾的 rfc822Name、dNSName 或 uniformResourceIdentifier 绕过该排除约束。
利用条件与风险
利用前提是攻击者控制或能获取带名称约束的中间 CA 所签发的证书。实战中可导致本应被排除的邮件地址、DNS 名称或 URI 主机通过证书路径校验,破坏 PKI 信任策略。
修复建议
官方已在 bc-csharp 2.7.0 中修复,建议升级至 2.7.0 或更高版本。暂无公开的临时缓解措施信息。
Improper certificate validation in PkixNameConstraintValidator in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows an attacker who controls, or can obtain certificates from, a name-constrained intermediate CA to have certificates accepted during PKIX certification path validation for email addresses, DNS names or URI hosts that lie within excluded subtrees applying to that CA, via an rfc822Name, dNSName or uniformResourceIdentifier name whose host ends with a dot, because names and constraints were compared without first removing the RFC 1034 root-label trailing dot, so a fully qualified host name did not match an excluded subtree for the same host written without the dot.