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

CVE-2026-16000: Bouncy Castle CCM Mode Cryptographic Flaw

CVE-2026-16000 is a cryptographic flaw in Bouncy Castle bc-csharp that allows attackers to forge valid authentication tags when observing encrypted messages. 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-16000 Overview

CVE-2026-16000 affects the DSTU 7624 CCM mode implementation (KCcmBlockCipher) in Legion of the Bouncy Castle bc-csharp before version 2.7.0. The flaw lets an attacker who can observe encrypted messages of known or chosen content forge ciphertexts with valid authentication tags. The root issue is a missing cryptographic step: the G1 block that binds the nonce, message length, and parameter flags into the CBC-MAC was processed only when associated data was present. When no associated data is supplied, the tag becomes a CBC-MAC of the plaintext alone and is independent of the nonce, enabling cross-nonce forgery.

Critical Impact

Applications calling KCcmBlockCipher directly without associated data lose authenticity guarantees, allowing attackers to forge valid ciphertexts and tamper with messages undetected.

Affected Products

  • Legion of the Bouncy Castle bc-csharp versions prior to 2.7.0
  • Applications using KCcmBlockCipher directly with no associated data (AAD)
  • .NET software stacks consuming DSTU 7624 CCM mode via Bouncy Castle C#

Discovery Timeline

  • 2026-10-02 - CVE CVE-2026-16000 published to NVD
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-16000

Vulnerability Analysis

The vulnerability is a broken-cryptography flaw [CWE-325: Missing Cryptographic Step] in the DSTU 7624 CCM mode. CCM derives authenticity by prepending a formatted G1 block to the CBC-MAC computation. G1 encodes the nonce, the plaintext length, and flag bits including the associated-data-present indicator. In bc-csharp before 2.7.0, the ProcessAAD routine skipped G1 processing entirely when no associated data was supplied. The resulting tag was computed over the plaintext only, with no cryptographic binding to the nonce.

Because the tag no longer depends on the nonce, an attacker who recovers a valid (ciphertext, tag) pair for a known plaintext can substitute a different nonce and the tag remains valid. The authenticity property that CCM is designed to provide is lost for this call pattern.

Root Cause

The ProcessAAD method in crypto/src/crypto/modes/KCcmBlockCipher.cs gated construction of the G1 nonce-binding block on the presence of associated data. DSTU 7624 instead treats the associated-data flag as a bit inside G1, so G1 must always be computed. Skipping G1 removes the nonce, length, and MAC-size commitments from the MAC input.

Attack Vector

An attacker who can observe or induce encryption of known or chosen plaintext under KCcmBlockCipher with no AAD can capture the tag and reuse it with a forged nonce. This enables ciphertext forgery against any receiver using the same key, breaking message integrity. Exploitation does not require privileges or user interaction.

text
 private void ProcessAAD(byte[] assocText, int assocOff, int assocLen, int dataLen)
 {
-    if (assocLen - assocOff < engine.GetBlockSize())
-    {
-        throw new ArgumentException("authText buffer too short");
-    }
-    if (assocLen % engine.GetBlockSize() != 0)
+    bool hasAssocText = assocLen > 0;
+
+    if (hasAssocText)
     {
-        throw new ArgumentException("padding not supported");
+        if (assocLen - assocOff < engine.GetBlockSize())
+        {
+            throw new ArgumentException("authText buffer too short");
+        }
+        if (assocLen % engine.GetBlockSize() != 0)
+        {
+            throw new ArgumentException("padding not supported");
+        }
     }

+    // The G1 block binds the nonce, data length and MAC-size flag into the MAC and must be
+    // processed unconditionally. Skipping G1 when no AAD is present leaves
+    // the MAC independent of the nonce and enables cross-nonce forgery.
     Array.Copy(nonce, 0, G1, 0, nonce.Length - Nb_ - 1);

     Pack.UInt32_To_LE((uint)dataLen, buffer, 0); // for G1

Source: GitHub Commit b01e9e6

Detection Methods for CVE-2026-16000

Indicators of Compromise

  • Successfully verified messages decrypted under a nonce that was never issued by a legitimate sender.
  • Duplicate authentication tags observed across encryption operations that used different nonces.
  • Application logs showing KCcmBlockCipher encryption or decryption calls where the associated data length is zero.

Detection Strategies

  • Inventory .NET projects and dependencies for BouncyCastle.Cryptography or bc-csharp packages at versions earlier than 2.7.0.
  • Perform static code analysis to flag direct instantiation of KCcmBlockCipher and call sites that pass no AAD.
  • Review protocol traces for DSTU 7624 CCM traffic exhibiting nonce reuse semantics or anomalous tag validation outcomes.

Monitoring Recommendations

  • Alert on new deployments that bundle vulnerable bc-csharp versions through software composition analysis.
  • Monitor authentication failures and tag-validation errors in services that consume DSTU 7624 CCM.
  • Track outbound integrity-sensitive flows for ciphertext replay patterns and unexpected nonce distributions.

How to Mitigate CVE-2026-16000

Immediate Actions Required

  • Upgrade bc-csharp to version 2.7.0 or later across all affected applications and build pipelines.
  • Audit code paths that construct KCcmBlockCipher directly and confirm whether associated data is supplied.
  • Rotate long-lived symmetric keys that may have been exposed through chosen-plaintext interactions with vulnerable services.

Patch Information

The fix is delivered in bc-csharp 2.7.0 via commit b01e9e6c0e231b90867fbaf03bf148bde6f9ccfb. The patch ensures the G1 nonce-binding block is processed unconditionally, restoring the nonce, length, and MAC-size commitments required by DSTU 7624 CCM. See the GitHub CVE-2026-16000 Documentation and the GitHub Commit Update.

Workarounds

  • Supply non-empty associated data to every KCcmBlockCipher encryption and decryption operation until the library is upgraded.
  • Replace DSTU 7624 CCM usage with a different authenticated encryption mode such as GCM where DSTU 7624 is not a protocol requirement.
  • Wrap vulnerable call sites with an application-layer MAC (for example HMAC over nonce and ciphertext) to restore authenticity until patching completes.
bash
# Upgrade the NuGet package to a fixed release
dotnet add package BouncyCastle.Cryptography --version 2.7.0

# Verify the resolved version in the project
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

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.