Skip to main content

CVE-2026-63569: CWE-20 Improper Input Validation in Legion of the Bouncy Castle Inc. bc-csharp

0
Critical
VulnerabilityCVE-2026-63569cvecve-2026-63569cwe-20
Published: 10/02/2026 (10/02/2026, 07:00:23 UTC)
Source: CVE Database V5
Vendor/Project: Legion of the Bouncy Castle Inc.
Product: bc-csharp

Description

Improper input validation in DHAgreement.CalculateAgreement (MTI/A0 two-pass Diffie-Hellman) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows an on-path attacker to make the local party compute an agreed value the attacker already knows, defeating the key authentication MTI/A0 is meant to provide. It also allows a malicious peer to learn the local static private key modulo the small factors of p-1, and to recover it entirely in groups with many such factors. The attack uses a crafted out-of-range or small-order ephemeral value, and works because that value is raised to the static private key without the range and subgroup-membership checks applied to DH public keys. Only applications that call DHAgreement directly are affected.

CVSS v4.0

Score 9.1critical

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Affected software

Legion of the Bouncy Castle Inc.

bc-csharp

Affected versions
>=0 <2.7.0
BouncyCastle.Cryptography
pkg:nuget/BouncyCastle.Cryptography
Affected versions
>=0 <2.7.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/02/2026, 14:57:18 UTC

Technical Analysis

The vulnerability arises from improper input validation in the DHAgreement.CalculateAgreement function of bc-csharp versions prior to 2.7.0. Specifically, the method fails to apply range and subgroup-membership checks to the ephemeral public keys used in the MTI/A0 two-pass Diffie-Hellman protocol. An attacker can send crafted out-of-range or small-order ephemeral values, causing the local party to compute an agreed key value already known to the attacker, thus defeating the intended key authentication. Furthermore, this flaw enables a malicious peer to learn the local static private key modulo small factors of p-1, and potentially recover the entire private key in groups with many such factors. This vulnerability is limited to applications that invoke DHAgreement directly.

Potential Impact

An attacker positioned on the communication path can manipulate the key agreement process to compute a shared secret known to them, effectively breaking the key authentication guarantees of the MTI/A0 Diffie-Hellman protocol. This compromises the confidentiality and integrity of the key exchange. Additionally, the attacker can extract partial or full information about the local static private key, undermining long-term key security. This could lead to further cryptographic attacks or impersonation. The vulnerability does not affect applications that do not call DHAgreement directly.

Mitigation Recommendations

A fixed version 2.7.0 of bc-csharp is available that addresses this vulnerability by properly validating input values in DHAgreement.CalculateAgreement. Users should upgrade to version 2.7.0 or later to remediate this issue. Until upgraded, avoid using DHAgreement directly or implement strict input validation and subgroup membership checks on ephemeral public keys to mitigate the risk.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
bcorg
Date Reserved
2026-07-16T23:48:46.076Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6abfc5e2a43b0b3b89c8de2a

Added to database: 10/02/2026, 14:55:30 UTC

Last enriched: 10/02/2026, 14:57:18 UTC

Last updated: 10/02/2026, 21:45:56 UTC

Views: 7

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses