IT SBIT Services
Schneeberger
DEEN
CVE tracker

bc-csharp: Bleichenbacher padding oracle in CMS RSA PKCS#1 v1.5 unwrap

CVE-2026-63573High 8.2

← All vulnerabilities

Summary

The CMS EnvelopedData decryption in bc-csharp (BouncyCastle.Cryptography) before 2.7.0 rejects RSA PKCS#1 v1.5 key-transport ciphertexts with invalid padding with a distinct error, while correctly padded ciphertexts fail only later at content decryption. An application that decrypts messages from untrusted parties and reveals this difference acts as a padding oracle. An attacker who holds a captured message and can submit many modified messages (typically thousands to millions) can recover the content-encryption key and read the message; the RSA private key is not disclosed. CVSS v4.0 base score is 8.2 (High), with impact limited to confidentiality.

Affected

  • bc-csharp (BouncyCastle.Cryptography) versions 0 to before 2.7.0
  • Applications that decrypt CMS EnvelopedData or AuthenticatedData with rsaEncryption key-transport recipients
  • Vendor wiki lists 2.6.2 and earlier and 2.7.0-beta.98 as affected

Fixed in

  • Fixed in bc-csharp 2.7.0

Workaround

  • Upgrading is the fix; no workaround is provided by the CVE record.
  • If upgrade is not immediately possible and all senders use RSA-OAEP or key agreement, refuse recipients whose KeyEncryptionAlgOid is rsaEncryption (1.2.840.113549.1.1.1) before calling GetContent or GetContentStream.
  • Handle and report all decryption failures identically and without detail to the sender.
  • The setting Org.BouncyCastle.Cms.AllowLenientRsaPkcs1 must stay at its default (false); enabling it restores the vulnerable behaviour.

Exploitation

  • Not known to be exploited; not listed in CISA KEV.
  • CISA SSVC: exploitation none, automatable no, technical impact partial.
  • EPSS 0.00308 (very low).
  • No public proof of concept found in limited searches.

Our recommendation

  • Identify applications that embed BouncyCastle.Cryptography (check software inventories and SBOMs for versions below 2.7.0).
  • Check whether these applications decrypt CMS or S/MIME messages from untrusted parties.
  • Upgrade to bc-csharp 2.7.0 or later, prioritising services that handle CMS messages from external senders.
  • Until patched, make sure decryption errors are not disclosed to senders and restrict who can submit messages to such endpoints.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 17:28.

Original description (NVD)

Observable discrepancy in the CMS RSA PKCS#1 v1.5 key-transport unwrap (KeyTransRecipientInformation.UnwrapKey) in Legion of the Bouncy Castle Inc. bc-csharp before 2.7.0 allows a remote attacker who holds a captured CMS EnvelopedData message, and who can submit many modified messages to an application that decrypts them with the recipient's RSA private key and reveals how decryption failed, to recover the captured message's content-encryption key and so its content, via a Bleichenbacher-style adaptive chosen-ciphertext attack, because a key-transport ciphertext with invalid PKCS#1 v1.5 padding is rejected during unwrap with a distinct "bad padding in message." CmsException instead of being replaced by a random key, so it can be told apart from a correctly padded ciphertext, which fails only later at content decryption.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.