CVE-2026-71885 Bouncy Castle Java MLS 证书绑定验证漏洞
影响攻击者可冒用受害者 X.509 身份加入群组、解密并伪造消息
Bouncy Castle for Java 1.86 之前的 MLS(RFC 9420)实现中,LeafNode.verify() 仅用叶节点自身携带的 signature_key 校验签名,而未解析和校验 credential 中的 X.509 证书链,导致证书公钥与 signature_key 未做绑定校验。攻击者可拿他人证书配合自己的密钥签署 LeafNode 和 KeyPackage,从而以受害者身份通过验证。
影响范围
Bouncy Castle for Java 1.86 之前的版本,具体受影响版本范围以官方公告为准。
漏洞详情
漏洞类型为身份认证/证书绑定校验缺失。RFC 9420 第 5.3 节要求终端实体证书公钥必须与 LeafNode 的 signature_key 匹配,但该实现只校验签名与叶节点内自带密钥的一致性,证书链被存储却从未解析验证。因此在允许外部提交且无独立凭证准入检查的部署中,未认证攻击者可用受害者证书加无关密钥构造 LeafNode,通过 KeyPackage.verify() 和群组叶节点校验路径被接纳为受害者身份。
利用条件与风险
利用前提是部署允许外部提交(external commit)且未做独立凭证准入校验;成功后可顶替受害者身份、将其逐出、推导当前 epoch、解密后续群消息并以受害者名义发送消息,实战风险高。
修复建议
升级到 Bouncy Castle for Java 1.86 或更高版本,该版本 TreeKEM.LeafNode 已要求终端实体证书公钥与签名密钥匹配。临时缓解措施为在应用层增加独立的凭证准入校验,或禁用未经验证的外部提交。
In Bouncy Castle for Java before 1.86, the Messaging Layer Security (MLS, RFC 9420) implementation did not bind an X.509 credential to a LeafNode’s signature_key. LeafNode.verify() checked a leaf’s signature against the signature_key carried in the leaf itself, while the credential’s X.509 certificate chain was stored but never parsed or validated, so the end-entity certificate’s public key was never required to match signature_key as RFC 9420 sec. 5.3 requires. A party could therefore present another party’s certificate as its credential while signing the leaf, and the enclosing KeyPackage, with an unrelated key, and be accepted under that other party’s identity through KeyPackage.verify() and the Group leaf-validation path. In a deployment that admits external commits without an independent credential-admission check, an unauthenticated attacker could be admitted under a victim’s X.509 identity, evict the victim (resynchronization compares whole credentials rather than signing keys), derive the current epoch, decrypt subsequent group messages, and send messages accepted as the victim. TreeKEM.LeafNode now requires the end-entity certificate’s subject public key, in the cipher suite’s signature encoding, to equal signature_key for an X.509 credential and rejects the leaf otherwise, including an empty chain or a certificate whose key type does not match the cipher suite; certificate-chain and identity validation to a trust anchor remain the application’s responsibility per RFC 9420 sec. 5.3.1. Deployments using only basic credentials are unaffected.