Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAct as malicious peer or on-path attacker
-
DeliverySend crafted small-order/out-of-range DH value
-
ExploitVictim exponentiates value with static private key
-
ExecutionObserve agreed value leaking key mod small factors
-
ImpactRecover full static private key via CRT or forge authenticated key
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation requires that the target application call DHAgreement.CalculateAgreement directly using the MTI/A0 two-pass Diffie-Hellman flow (higher-level protocol wrappers are not affected). The attacker must be a protocol peer or an on-path attacker able to inject a crafted 'message' or public-key value. For authentication defeat (making the local party compute an attacker-known value), on-path peer interaction suffices. For private-key disclosure, the local party must reuse a STATIC DH private key; the attacker then learns the key modulo the small factors of p-1, and full recovery additionally requires a group (parameter p) whose p-1 has many small prime factors. Limiting factors that reduce realistic risk: the narrow API surface (direct DHAgreement callers only), the requirement for static/reused keys rather than ephemeral keys, and the dependence on weak group parameters for complete key recovery. |
| Impact | This is a genuine high-priority cryptographic flaw, but its real-world blast radius is narrower than the 9.1 score suggests. The provided CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H) signals a network-reachable, unauthenticated issue with high confidentiality and integrity impact - consistent with recovery of the local static private key and defeat of MTI/A0 key authentication. However, the AT:P (Attack Requirements: Present) metric is doing significant work and must not be ignored: exploitation requires the attacker to be a protocol peer or on-path, and full key recovery additionally requires that the victim reuse a static DH private key and operate in a group whose p-1 has many small factors. A patch is confirmed available from the vendor. No EPSS score was provided, there is no CISA KEV listing, and no public exploit (POC) was identified in the input - so exploitation status is: no public exploit identified at time of analysis. The core technique (small-subgroup confinement / invalid-curve-style key recovery via CRT) is well-understood academically, which raises the plausibility of exploitation against vulnerable deployments, but there is no evidence of active exploitation. Net assessment: real cryptographic priority for the specific population that calls DHAgreement directly with reused keys, but not a mass-exploitation 'patch tonight everywhere' event. |
| Exploit ScenarioDerived | An application uses bc-csharp's DHAgreement (MTI/A0 two-pass Diffie-Hellman) with a static/reused DH private key. A malicious peer or on-path attacker submits a crafted out-of-range or small-order ephemeral value, which the victim raises to its static private key without range or subgroup-membership validation; the resulting agreed value leaks the private key modulo the small factors of p-1, enabling partial or (in groups with many small factors) full key recovery, or lets the attacker force a known shared value and defeat MTI/A0 authentication. No public exploit was identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 02, 2026
Crafted small-order or out-of-range Diffie-Hellman values passed to DHAgreement.CalculateAgreement in Bouncy Castle C
(bc-csharp) before 2.7.0 let an on-path attacker or malicious peer defeat the key authentication MTI/A0 is designed to provide and, when the local party reuses a static DH private key, learn that key modulo the small factors of p-1 - with full recovery possible in groups where p-1 has many small prime factors. The issue is unauthenticated (CVSS:3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N), and exploitation is not opportunistic: it works only where an application calls DHAgreement directly in an MTI/A0 two-pass flow, and it requires a protocol peer or on-path attacker able to inject a crafted 'message' or public-key value; higher-level Bouncy Castle protocol wrappers are unaffected. No public exploit code or confirmed active exploitation was identified at time of analysis, and the independent assessment rates real-world blast radius as narrower than the 9.1 CVSS 4.0 base score suggests because of the narrow direct-caller API surface, the static-key reuse prerequisite, and the dependence on weak group parameters for complete key recovery.
RemediationAI
Upgrade bc-csharp to 2.7.0 or later - the vendor-released patch for this issue - and rebuild any application that references the library; the corresponding upstream fix is commit fe236ad207c5960eeae1ebb6560c783a3bb5b692, with details in the vendor advisory at https://github.com/bcgit/bc-csharp/wiki/CVE-2026-63569. If an immediate upgrade is not possible, the most effective compensating control is to stop calling DHAgreement.CalculateAgreement directly with untrusted peer input: validate every peer-supplied 'message' and public-key value before use by checking 1 < value < p-1 and confirming subgroup membership, and reject any DHPublicKeyParameters whose Y comes from an overridden virtual property or a subclass rather than the base type (the trade-off is added application code and the risk of incomplete checks that the library now performs correctly); alternatively, move the agreement into a higher-level Bouncy Castle protocol wrapper that performs these validations, at the cost of a larger code change. If direct DHAgreement use must continue temporarily, use ephemeral DH private keys rather than a reused static key - this prevents private-key recovery and leaves only the authentication-defeat impact - and ensure group parameters use a safe prime p whose p-1 contains large prime factors, since complete key recovery depends on p-1 having many small prime factors; note these are risk-reduction measures, not fixes, and neither removes the underlying missing-validation defect.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is an improper input validation issue (CWE-20) in the MTI/A0 two-pass Diffie-Hellman key agreement implemented by crypto/src/crypto/agreement/DHAgreement.cs in the Bouncy Castle C
library (CPE cpe:2.3:a:legion_of_the_bouncy_castle_inc.:bc-csharp). MTI/A0 exchanges explicit ephemeral contributions ('message') alongside static DH key material; CalculateAgreement raises the peer-supplied message to the local party's private key with BigInteger.ModPow. In the vulnerable code path, the peer-supplied 'message' BigInteger was used directly without the range check ((1, p-1)) and subgroup-membership validation that DHPublicKeyParameters applies to a DH public value Y, and the peer's Y was trusted based on its declared type - but Y is a virtual property, so a subclass could override it to return an unvalidated value that passed construction-time checks. Because both peer-controlled values end up exponentiated by a potentially static private key, an attacker can submit a small-order or out-of-range element and mount a small-subgroup confinement attack: the resulting shared secret collapses to a value the attacker already knows, defeating the authentication MTI/A0 is meant to supply, and by observing the local party's response the attacker recovers the static private key modulo the small factors of p-1 (via CRT), fully reconstructing it when p-1 has many small prime factors. The upstream fix validates the raw message by constructing a DHPublicKeyParameters from it, and re-validates pub.Y unless pub is exactly the base DHPublicKeyParameters type, so subclasses with overridden Y are re-checked rather than trusted; accompanying tests add malicious-message and malicious-public-key cases (including a DHWeakPubKey subclass) to DHTest.cs. Scope is deliberately limited: only applications that call DHAgreement directly are affected, and exploitation for key disclosure requires a reused static private key rather than ephemeral keys.
Know when Bc Csharp gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
PR:N as no authentication is needed, but AC:H because exploitation requires on-path/peer position plus static-key reuse and weak group factors; C:H/I:H for private-key recovery and key-authentication bypass, A:N.
Primary rating from Vendor (bcorg).
CVSS VectorVendor: bcorg
DescriptionCVE.org
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.
Executive ViewAI
Bouncy Castle C
(bc-csharp) versions prior to 2.7.0 contain a critical cryptographic flaw in the DHAgreement.CalculateAgreement method that can expose static Diffie-Hellman private keys for organizations that implement MTI/A0 two-pass key exchange directly against this library. Exposure is confined to applications that call the low-level DHAgreement API rather than standard Bouncy Castle protocol wrappers, so impact is concentrated in custom or vendor crypto integrations; affected organizations face potential decryption of protected traffic and impersonation of their systems by an on-path attacker or malicious peer. Leadership should prioritize confirming whether any in-house or third-party application relies on this direct API before setting remediation urgency.
Apply vendor patch (bc-csharp 2.7.0 or later); until upgrades complete, rotate any static Diffie-Hellman private keys and avoid reusing static DH keys with untrusted or unauthenticated peers in direct DHAgreement MTI/A0 flows.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Memory exhaustion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows a remote, unauthenticated attacker to cause a deni
Memory-exhaustion denial of service in the C# DTLS implementation of Bouncy Castle (bc-csharp) before 2.7.0 lets a remot
Denial of service in Legion of the Bouncy Castle's C# cryptography library (bc-csharp) before 2.7.0 lets an unauthentica
Uncontrolled recursion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows unauthenticated remote attackers to crash or
Denial of service in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows unauthenticated remote attackers to
Denial of service in the Legion of the Bouncy Castle C# library (bc-csharp) affects all versions before 2.7.0, where qua
Authentication-tag forgery in Legion of the Bouncy Castle Inc. bc-csharp (Bouncy Castle C#) before 2.7.0 lets a remote,
Forged X.509 attribute certificates are accepted as valid by Legion of the Bouncy Castle Inc. bc-csharp versions before
Observable padding discrepancy in the IES/ECIES decryption path of Bouncy Castle C# (bc-csharp) before 2.7.0 lets an una
RSA PKCS#1 v1.5 key transport in the Bouncy Castle C# (bc-csharp) CMS implementation before 2.7.0 is vulnerable to a Ble
Information disclosure in Bouncy Castle C# (bc-csharp) versions before 2.7.0 allows unauthenticated remote attackers to
Certificates that should be rejected by PKIX name constraints are accepted by Legion of the Bouncy Castle Inc. bc-csharp
EUVD-2026-91220
GHSA-m2m9-m35w-rfxg
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB