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-15999 Overview
CVE-2026-15999 is an improper integrity check validation flaw [CWE-354] in the AES-CCM implementation of the Bouncy Castle bc-csharp cryptographic library before version 2.7.0. The CcmParameters class accepts any authentication tag length, and CcmBlockCipher validates the tag length only during encryption. During decryption, the library compares a tag of whatever length the attacker-controlled AlgorithmIdentifier specifies, including zero. An on-path attacker can modify CCM-encrypted content without detection by supplying a CCMParameters structure that declares an aes-ICVlen of zero or a value outside the RFC 5084 set.
Critical Impact
On-path attackers can tamper with AES-CCM-encrypted CMS EnvelopedData payloads without triggering authentication failures, breaking integrity guarantees for downstream consumers.
Affected Products
- Legion of the Bouncy Castle Inc. bc-csharp versions prior to 2.7.0
- Applications using CmsEnvelopedData or CmsEnvelopedDataParser with AES-CCM
- Any caller passing an unvalidated tag length to CcmBlockCipher for decryption via ParameterUtilities.GetCipherParameters
Discovery Timeline
- 2026-10-02 - CVE-2026-15999 published to NVD
- 2026-10-02 - Last updated in NVD database
Technical Details for CVE-2026-15999
Vulnerability Analysis
AES-CCM (Counter with CBC-MAC) is an authenticated encryption mode that relies on a Message Authentication Code (MAC) tag to detect tampering. RFC 5084 constrains the integrity check value (ICV) length to the set {4, 6, 8, 10, 12, 14, 16} bytes for CMS use. The bc-csharp implementation failed to enforce this constraint at two points. First, CcmParameters accepted any integer as icvLen, including zero, when parsing an ASN.1 AlgorithmIdentifier. Second, CcmBlockCipher.GetMacSize applied length validation only when the forEncryption flag was true.
This mismatch allowed an attacker-controlled ciphertext to specify a zero-length or arbitrarily short tag at decryption time. The MAC comparison then operated on a truncated or empty value. The practical consequence is loss of integrity: ciphertext bits can be modified in transit, and the decrypted plaintext is accepted as authentic.
Root Cause
The root cause is incomplete input validation in two cooperating classes [CWE-354]. The CcmParameters ASN.1 constructor stored any supplied icvLen value verbatim. The CcmBlockCipher initialization path validated the MAC size only for the encryption direction, trusting the caller for decryption. Together, these omissions let a malicious CCMParameters structure in CMS EnvelopedData dictate a tag length that defeats authentication.
Attack Vector
The attack requires a network position between a sender and receiver exchanging CMS EnvelopedData protected with AES-CCM. The attacker rewrites the AlgorithmIdentifier to set aes-ICVlen to zero or another non-RFC-5084 value, modifies the ciphertext, and recomputes the (now trivial) authentication tag. When the receiver processes the message through CmsEnvelopedDataParser, decryption succeeds and the tampered plaintext is returned to the application.
// Patch: crypto/src/asn1/cms/CcmParameters.cs
if (pos != count)
throw new ArgumentException("Unexpected elements in sequence", nameof(seq));
- m_icvLen = icvLen == null ? DefaultIcvLen : icvLen.IntValueExact;
+ m_icvLen = ValidateIcvLen(icvLen == null ? DefaultIcvLen : icvLen.IntValueExact);
}
public CcmParameters(byte[] nonce, int icvLen)
{
m_nonce = DerOctetString.FromContents(nonce);
- m_icvLen = icvLen;
+ m_icvLen = ValidateIcvLen(icvLen);
}
Source: GitHub Commit 2818bdf
// Patch: crypto/src/crypto/modes/CcmBlockCipher.cs
{
nonce = aeadParameters.GetNonce();
initialAssociatedText = aeadParameters.GetAssociatedText();
- macSize = GetMacSize(forEncryption, aeadParameters.MacSize);
+ macSize = GetMacSize(aeadParameters.MacSize);
cipherParameters = aeadParameters.Key;
}
else if (parameters is ParametersWithIV parametersWithIV)
{
nonce = parametersWithIV.GetIV();
initialAssociatedText = null;
- macSize = GetMacSize(forEncryption, 64);
+ macSize = GetMacSize(64);
cipherParameters = parametersWithIV.Parameters;
}
Source: GitHub Commit 9d284d8
Detection Methods for CVE-2026-15999
Indicators of Compromise
- CMS EnvelopedData messages whose AES-CCM AlgorithmIdentifier declares an aes-ICVlen of 0 or a value not in {4, 6, 8, 10, 12, 14, 16}.
- Successful decryption events for AES-CCM payloads where the authentication tag length is shorter than 32 bits.
- Application dependencies resolving to BouncyCastle.Cryptography NuGet packages prior to 2.7.0.
Detection Strategies
- Perform a software composition analysis (SCA) scan of .NET projects for bc-csharp versions below 2.7.0 and flag them for upgrade.
- Parse captured CMS messages and alert when CCMParameters.aes-ICVlen falls outside the RFC 5084 set.
- Add instrumentation around ParameterUtilities.GetCipherParameters and CcmBlockCipher.Init calls to log the negotiated macSize during decryption.
Monitoring Recommendations
- Record all AES-CCM decryption operations with their tag lengths in centralized application logs for anomaly review.
- Monitor TLS-terminating proxies and messaging middleware for repeated malformed CMS structures from the same source.
- Correlate build pipeline SBOM output with vulnerability feeds so new bc-csharp advisories trigger ticketing automatically.
How to Mitigate CVE-2026-15999
Immediate Actions Required
- Upgrade the BouncyCastle.Cryptography NuGet package to version 2.7.0 or later across all affected .NET services.
- Audit application code paths that invoke CcmBlockCipher or process CmsEnvelopedData protected with AES-CCM.
- Rebuild and redeploy any container images, Lambda functions, or installers that bundle vulnerable bc-csharp assemblies.
Patch Information
The fix is delivered in bc-csharp 2.7.0. Commit 2818bdf adds ValidateIcvLen enforcement to both CcmParameters and GcmParameters. Commit 9d284d8 removes the forEncryption conditional from CcmBlockCipher.GetMacSize, enforcing the tag-length check on decryption as well. See the GitHub CVE-2026-15999 Wiki for the project's advisory.
Workarounds
- Wrap calls to CcmBlockCipher with application-side validation that rejects any macSize less than 32 bits or not aligned to the RFC 5084 set.
- Reject inbound CMS EnvelopedData whose AlgorithmIdentifier parameters do not conform to the expected tag length before passing them to CmsEnvelopedDataParser.
- Prefer AES-GCM with a 128-bit tag at the protocol layer where feasible, and pin tag length in configuration rather than reading it from the message.
# Upgrade Bouncy Castle for .NET to the patched release
dotnet add package BouncyCastle.Cryptography --version 2.7.0
# Verify no transitive dependency pulls in an older version
dotnet list package --include-transitive | 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

