Skip to main content

Bouncy Castle C# CVE-2026-63569

| EUVDEUVD-2026-91220 CRITICAL
Improper Input Validation (CWE-20)
2026-10-02 bcorg GHSA-m2m9-m35w-rfxg
9.1
CVSS 4.0 · Vendor: bcorg
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Act as malicious peer or on-path attacker
  2. Delivery
    Send crafted small-order/out-of-range DH value
  3. Exploit
    Victim exponentiates value with static private key
  4. Execution
    Observe agreed value leaking key mod small factors
  5. Impact
    Recover 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

bc-csharp 0 <2.7.0

Affected Packages

euvd bc_csharp fix: 2.7.0

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

Vendor (bcorg) PRIMARY 9.1 CRITICAL
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
vuln.today AI 7.4 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (bcorg).

CVSS VectorVendor: bcorg

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 69% exploitable
Prevalence
High
Bouncy Castle C# is a widely deployed crypto library across the .NET ecosystem
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-103603 HIGH
8.7 Oct 02

Memory exhaustion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows a remote, unauthenticated attacker to cause a deni

CVE-2026-63566 HIGH
8.7 Oct 02

Memory-exhaustion denial of service in the C# DTLS implementation of Bouncy Castle (bc-csharp) before 2.7.0 lets a remot

CVE-2026-63568 HIGH
8.7 Oct 02

Denial of service in Legion of the Bouncy Castle's C# cryptography library (bc-csharp) before 2.7.0 lets an unauthentica

CVE-2026-103600 HIGH
8.7 Oct 02

Uncontrolled recursion in Bouncy Castle C# (bc-csharp) before 2.7.0 allows unauthenticated remote attackers to crash or

CVE-2026-63574 HIGH
8.7 Oct 02

Denial of service in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows unauthenticated remote attackers to

CVE-2026-103604 HIGH
8.7 Oct 02

Denial of service in the Legion of the Bouncy Castle C# library (bc-csharp) affects all versions before 2.7.0, where qua

CVE-2026-16000 HIGH
8.7 Oct 02

Authentication-tag forgery in Legion of the Bouncy Castle Inc. bc-csharp (Bouncy Castle C#) before 2.7.0 lets a remote,

CVE-2026-63571 HIGH
8.7 Oct 02

Forged X.509 attribute certificates are accepted as valid by Legion of the Bouncy Castle Inc. bc-csharp versions before

CVE-2026-63567 HIGH
8.2 Oct 02

Observable padding discrepancy in the IES/ECIES decryption path of Bouncy Castle C# (bc-csharp) before 2.7.0 lets an una

CVE-2026-63573 HIGH
8.2 Oct 02

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

CVE-2026-103601 HIGH
8.2 Oct 02

Information disclosure in Bouncy Castle C# (bc-csharp) versions before 2.7.0 allows unauthenticated remote attackers to

CVE-2026-103602 HIGH
8.2 Oct 02

Certificates that should be rejected by PKIX name constraints are accepted by Legion of the Bouncy Castle Inc. bc-csharp

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy