BouncyCastle.Cryptography is vulnerable to Improper Input Validation
91
CVE Score
Critical
Improper Input Validation
Bouncy Castle's DHAgreement.CalculateAgreement raises a peer-supplied ephemeral value to the local static private key without first validating its range or subgroup membership. An on-path attacker can force a shared secret they already know and defeat MTI/A0 key authentication, while a malicious peer can use small-order values to leak or recover the static private key.
Upgrade the BouncyCastle.Cryptography package to the patch version. If an immediate upgrade is not possible, validate the peer's ephemeral value by constructing a DHPublicKeyParameters with the same domain parameters before passing it to CalculateAgreement, and abandon the exchange if validation fails.
You are affected if your application calls DHAgreement directly for MTI/A0 Diffie-Hellman and accepts peer-controlled agreement values. Bouncy Castle's own TLS and agreement factory code uses DHBasicAgreement and is not affected.
2.0.0 - 2.6.2
Fixed in 2.7.0BouncyCastle.Cryptography is vulnerable to Improper Input Validation in versions 2.0.0 - 2.6.2.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.