天下漏洞,尽知其名
MEDIUM

CVE-2026-103601 Bouncy Castle bc-csharp 未验证明文释放漏洞

影响攻击者可获取任意密文的解密结果,破坏机密性

MEDIUM
暂无 CVSS 评分
AI 研判

Bouncy Castle bc-csharp 在 CCM 与 DSTU 7624 CCM 两种 AEAD 模式的解密实现中,先向调用方提供的输出缓冲区写入恢复出的明文,之后才校验认证标签,校验失败时明文仍残留在缓冲区中。若应用允许观察该缓冲区(如缓冲区复用或日志记录),远程攻击者可通过伪造消息获取任意密文的解密结果。

影响范围

Bouncy Castle bc-csharp

漏洞详情

该漏洞属于未验证明文释放(Release of Unverified Plaintext)类问题,成因是解密流程顺序错误:在认证标签校验之前就把明文写入调用方传入的输出缓冲区,且校验失败后未清除。攻击者向使用受影响 API 的应用发送伪造的 AEAD 密文,即可借助缓冲区复用、日志输出等途径读取本不应被信任的明文。仅影响解密到调用方提供缓冲区的方法,返回新分配数组的方法不受影响。

利用条件与风险

利用前提是应用使用受影响的 CCM/KCcm 解密接口并传入调用方缓冲区,且该缓冲区内容可被攻击者观察(如复用或记录日志)。实战中可导致敏感数据泄露,但需满足上述特定使用方式,故评级为中危。

修复建议

升级 bc-csharp 至 2.7.0 或更高版本;临时缓解措施为改用返回新分配数组的解密方法,或在认证失败后立即清空/丢弃输出缓冲区,避免其内容被复用或记录。

原始情报

Release of unverified plaintext in the CCM (CcmBlockCipher) and DSTU 7624 CCM (KCcmBlockCipher) AEAD modes in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows a remote attacker to obtain decryptions of ciphertexts of their choosing via forged messages sent to an application that lets the output buffer of a failed decryption be observed, for example through buffer reuse or logging, because decryption wrote the recovered plaintext into the caller-supplied output buffer before checking the authentication tag and left it there when the check failed. Only decryption into a caller-supplied buffer is affected; methods that return a newly allocated array are not.