Skip to main content
Vulnerability Database/CVE-2026-63573

CVE-2026-63573: Bouncy Castle CMS RSA Information Disclosure

CVE-2026-63573 is an information disclosure vulnerability in Legion of the Bouncy Castle bc-csharp library affecting CMS RSA PKCS#1 v1.5 key-transport unwrap operations. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-63573 Overview

CVE-2026-63573 is an observable discrepancy vulnerability [CWE-203] in the Legion of the Bouncy Castle bc-csharp library before version 2.7.0. The flaw resides in KeyTransRecipientInformation.UnwrapKey, which handles Cryptographic Message Syntax (CMS) RSA PKCS#1 v1.5 key-transport unwrapping. Invalid padding produces a distinct CmsException with the message bad padding in message, while well-padded ciphertexts fail later during content decryption. An attacker holding a captured CMS EnvelopedData message can submit many modified variants and distinguish padding results, enabling a Bleichenbacher-style adaptive chosen-ciphertext attack to recover the content-encryption key.

Critical Impact

Remote attackers can recover the plaintext of captured CMS messages encrypted with the recipient's RSA private key by abusing a padding oracle, breaking confidentiality of protected content.

Affected Products

  • Legion of the Bouncy Castle Inc. bc-csharp versions prior to 2.7.0
  • .NET applications using KeyTransRecipientInformation.UnwrapKey for CMS RSA PKCS#1 v1.5 decryption
  • Any service that decrypts attacker-submittable CMS EnvelopedData messages and reveals failure causes

Discovery Timeline

  • 2026-10-02 - CVE-2026-63573 published to the National Vulnerability Database
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-63573

Vulnerability Analysis

The vulnerability is a classic padding oracle in the RSA PKCS#1 v1.5 key-transport unwrap path of CMS. When a recipient decrypts an EnvelopedData message, the recipient's RSA private key unwraps the content-encryption key (CEK). Correct Bleichenbacher-safe implementations substitute a random key on invalid padding so that downstream decryption fails identically whether the ciphertext was well-padded or not. Bouncy Castle bc-csharp instead threw a distinct CmsException with the text bad padding in message on invalid padding, while valid padding proceeded and failed later at content decryption. This behavioral split forms an observable discrepancy an attacker can measure.

Root Cause

The root cause is non-constant-time error handling during PKCS#1 v1.5 unwrap in crypto/src/cms/KeyTransRecipientInformation.cs. The code reported padding validity through an exception path rather than returning a synthetic random key of the expected CEK length. Any application that propagates or logs the exception, or that behaves differently when unwrap fails versus when content decryption fails, leaks the padding oracle to the network.

Attack Vector

An attacker who has captured one legitimate CMS EnvelopedData message and can submit modified variants to a decryption endpoint iteratively crafts ciphertexts related to the target. Each submission reveals whether the modified RSA ciphertext produced valid PKCS#1 v1.5 padding, based on the observed exception or error signal. Over roughly a million queries the attacker narrows the target CEK and recovers the plaintext content without the private key.

text
// Patch excerpt: constant-time RSA PKCS#1 v1.5 key-transport unwrap
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Operators;
 using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Crypto.Utilities;
 using Org.BouncyCastle.Security;
+using Org.BouncyCastle.Utilities;

 namespace Org.BouncyCastle.Cms
 {

Source: bc-csharp commit 85679cc

text
// Patch excerpt: whitelist of fixed-size algorithms used to bound constant-time unwrap
+        private static readonly HashSet<string> FixedKeySizeAlgorithms =
+            new HashSet<string>(StringComparer.OrdinalIgnoreCase)
+            {
+                "AES128", "AES192", "AES256", "ARIA128", "ARIA192", "ARIA256",
+                "CAMELLIA128", "CAMELLIA192", "CAMELLIA256", "DES", "DESEDE3",
+                "IDEA", "SEED",
+            };

Source: bc-csharp GeneratorUtilities.cs patch

Detection Methods for CVE-2026-63573

Indicators of Compromise

  • Repeated CMS decryption requests from a single source containing structurally similar EnvelopedData payloads with varying encryptedKey fields.
  • High volume of CmsException entries referencing bad padding in message in application or framework logs.
  • Unusual latency distributions between failed unwrap operations and failed content decryption operations originating from the same client.

Detection Strategies

  • Instrument the CMS decryption endpoint to count UnwrapKey failures per source identity and alert on burst thresholds consistent with Bleichenbacher queries (hundreds of thousands to millions).
  • Build detections that correlate repeated submissions of CMS messages sharing the same originator, recipient, or content metadata but with different encryptedKey values.
  • Review application code paths that catch CmsException and ensure they do not propagate differentiated error messages or status codes to callers.

Monitoring Recommendations

  • Enable verbose logging on CMS recipient processing and ship events to a central data lake for behavioral analysis.
  • Monitor outbound responses from decryption services for distinguishable error signaling, including HTTP status codes and response timing variance.
  • Audit the deployed version of BouncyCastle.Cryptography across .NET workloads and track exposure to versions earlier than 2.7.0.

How to Mitigate CVE-2026-63573

Immediate Actions Required

  • Upgrade bc-csharp to version 2.7.0 or later across all .NET applications and services that process CMS EnvelopedData.
  • Inventory every service that decrypts attacker-submittable CMS messages with an RSA key-transport recipient and prioritize those exposed to untrusted networks.
  • Rotate RSA key-transport private keys where logs indicate sustained decryption probing, and reissue associated certificates.

Patch Information

The fix is delivered in Bouncy Castle bc-csharp 2.7.0. The patched KeyTransRecipientInformation.UnwrapKey performs a constant-time PKCS#1 v1.5 unwrap, substituting a random key of the correct length on invalid padding so that padding validity cannot be distinguished from later content decryption failures. See bc-csharp commit 85679cc, follow-up commit c38b479, and the bc-csharp CVE-2026-63573 wiki entry for details.

Workarounds

  • Where upgrade is not immediately possible, migrate CMS recipients from RSA PKCS#1 v1.5 key transport to RSA-OAEP (id-RSAES-OAEP) key-transport algorithms.
  • Ensure application exception handlers return a single generic decryption error without disclosing whether failure occurred during unwrap or content decryption.
  • Rate-limit CMS decryption endpoints per source identity and block clients that generate abnormal volumes of decryption failures.
bash
# Verify the installed BouncyCastle.Cryptography package version in a .NET project
dotnet list package --include-transitive | grep -i BouncyCastle

# Upgrade to the patched release
dotnet add package BouncyCastle.Cryptography --version 2.7.0

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.