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-16001 Overview
CVE-2026-16001 is a cryptographic weakness in the Legion of the Bouncy Castle bc-csharp library affecting versions before 2.7.0. The flaw resides in IesEngine when constructed without a block cipher (stream mode). An attacker who observes a single encrypted message with known plaintext can recover the Message Authentication Code (MAC) key for any shorter message encrypted under the same static key pair. This enables forgery of ciphertexts that the recipient will accept as authentic. The vulnerability is classified under CWE-354: Improper Validation of Integrity Check Value.
Critical Impact
A remote attacker with one known-plaintext ciphertext can forge arbitrary shorter authenticated messages, breaking the integrity guarantees of the Integrated Encryption Scheme.
Affected Products
- Legion of the Bouncy Castle bc-csharp versions prior to 2.7.0
- Applications using IesEngine instantiated without a block cipher (stream mode)
- .NET software relying on Bouncy Castle Integrated Encryption Scheme (IES) for authenticated encryption
Discovery Timeline
- 2026-10-02 - CVE CVE-2026-16001 published to NVD
- 2026-10-02 - Last updated in NVD database
Technical Details for CVE-2026-16001
Vulnerability Analysis
The Integrated Encryption Scheme (IES) implemented by IesEngine derives both an encryption key and a MAC key from a Key Derivation Function (KDF). In stream mode, the encryption step XORs the plaintext with a keystream of equal length produced by the KDF. The MAC key is then taken from the KDF output immediately following the keystream segment used for encryption.
Because the KDF input depends only on the static key pair and fixed parameters, the derived output is deterministic across messages. When an attacker learns one plaintext-ciphertext pair, XOR of the two recovers the keystream bytes used for that message. Any shorter message encrypted under the same parameters consumes fewer keystream bytes, so its MAC key sits inside the keystream already revealed by the longer message.
Root Cause
The root cause is improper domain separation between encryption and authentication key material. The design derives the MAC key from positions in the KDF output that overlap with keystream material disclosed by encryption of a longer message. Variable-length output layered on a static derivation input violates the integrity assumption that MAC keys remain secret.
Attack Vector
The attacker observes a single IES-encrypted message in stream mode where the plaintext is known or guessable. XORing the ciphertext with the known plaintext yields the keystream. The attacker then crafts a shorter plaintext, encrypts it with the recovered keystream prefix, and computes a valid MAC tag using the MAC key extracted from the subsequent bytes of the same disclosed keystream. The recipient validates the tag successfully and accepts the forged message.
-using System;
-using Org.BouncyCastle.Crypto;
-
namespace Org.BouncyCastle.Crypto.Parameters
{
- /**
- * parameters for using an integrated cipher in stream mode.
- */
- public class IesParameters : ICipherParameters
+ /// <summary>Parameters for using an integrated cipher in stream mode.</summary>
+ public class IesParameters
+ : ICipherParameters
{
- private byte[] derivation;
- private byte[] encoding;
- private int macKeySize;
+ private readonly byte[] m_derivation;
+ private readonly byte[] m_encoding;
+ private readonly int m_macKeySize;
Source: bc-csharp commit f881400b — patch to crypto/src/crypto/parameters/IesParameters.cs as part of the IES engine update from the Java reference implementation.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-16001
Indicators of Compromise
- Unexpected successful decryption of messages whose plaintext does not match prior application semantics or schema
- Receipt of IES-authenticated messages with lengths shorter than a previously processed message under the same key pair
- Application logs showing MAC validation success followed by downstream parsing errors or anomalous state transitions
Detection Strategies
- Perform a software composition analysis (SCA) scan across .NET build artifacts to locate BouncyCastle.Cryptography package versions below 2.7.0
- Grep source repositories for direct instantiation of IesEngine without a block cipher argument
- Audit cryptographic protocol traffic for repeated use of the same static key pair across variable-length ciphertexts
Monitoring Recommendations
- Enable detailed logging on cryptographic operations invoking IesEngine.ProcessBlock and track message length distributions
- Alert on application-layer messages that authenticate successfully but deserialize into unexpected or malformed objects
- Monitor dependency manifests (.csproj, packages.lock.json) in CI/CD pipelines for vulnerable Bouncy Castle versions
How to Mitigate CVE-2026-16001
Immediate Actions Required
- Upgrade BouncyCastle.Cryptography to version 2.7.0 or later across all .NET services and client applications
- Rotate any long-lived IES static key pairs that may have been used with the vulnerable stream-mode configuration
- Treat historical ciphertexts transmitted under vulnerable keys as potentially replayable in forged shorter forms
Patch Information
The fix is delivered in bc-csharp 2.7.0 via commit f881400b761134160ec2a05fd27c3e569453788d, which updates IesParameters and the IES engine using corrections from the bc-java reference implementation. See the CVE-2026-16001 wiki entry and the upstream patch commit for the authoritative advisory.
Workarounds
- Construct IesEngine with a block cipher (CBC mode) instead of the stream-mode variant until upgrade is possible
- Avoid reusing the same static key pair for messages of varying lengths within the same protocol
- Wrap IES-protected channels in an additional authenticated transport layer such as TLS 1.3 to limit attacker exposure to ciphertexts
# Update the Bouncy Castle package in a .NET project to the fixed release
dotnet add package BouncyCastle.Cryptography --version 2.7.0
# Verify the installed version
dotnet list package | grep -i BouncyCastle
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

