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-103603 Overview
CVE-2026-103603 is a memory exhaustion vulnerability in the Legion of the Bouncy Castle bc-csharp cryptographic library. The flaw affects the Hierarchical Signature System / Leighton-Micali Signature (HSS/LMS) post-quantum signature parsing code in HssPublicKeyParameters and HssSignature. A remote unauthenticated attacker who supplies a crafted HSS public key and signature can trigger allocation of up to approximately 17 GB of memory, causing an OutOfMemoryException and denial of service. The root cause is a missing bounds check on the level count L parsed from the HSS public key. The issue is fixed in bc-csharp version 2.7.0.
Critical Impact
A single signature verification call against attacker-controlled input can exhaust process memory, crashing applications or services that validate HSS/LMS signatures with Bouncy Castle for .NET.
Affected Products
- Legion of the Bouncy Castle bc-csharp versions prior to 2.7.0
- .NET applications using the Org.BouncyCastle.Pqc.Crypto.Lms namespace for HSS/LMS signature verification
- Downstream products embedding vulnerable bc-csharp releases for post-quantum cryptography
Discovery Timeline
- 2026-10-02 - CVE-2026-103603 published to NVD
- 2026-10-02 - Last updated in NVD database
Technical Details for CVE-2026-103603
Vulnerability Analysis
The HSS/LMS scheme defined in RFC 8554 is a stateful hash-based post-quantum signature algorithm. An HSS public key begins with a 32-bit big-endian integer L that specifies the number of levels in the HSS hierarchy. RFC 8554 Section 6 limits L to the range 1 through 8. The vulnerable HssPublicKeyParameters.Parse method in bc-csharp read L directly without validating this bound. The paired HssSignature.Parse logic then allocated an array of L - 1 entries before reading any further signature bytes.
Because L is attacker-controlled and can approach Int32.MaxValue, the allocation may consume roughly 17 GB of managed memory. The condition maps to [CWE-789: Memory Allocation with Excessive Size Value]. Exploitation requires only that the attacker can deliver both key and signature material to a verifier.
Root Cause
The parser trusted the length field in untrusted input. No sanity check compared L against the RFC 8554 maximum of 8 before downstream code used the value as an allocation size. This is a classic unvalidated length-prefix parsing bug applied to a cryptographic container format.
Attack Vector
An attacker submits a malformed HSS public key with a large L value together with a signature to any endpoint that invokes HssSignature.Verify or related parsing APIs. No authentication or user interaction is required. Services that accept externally supplied certificates, signed artifacts, or firmware blobs validated with HSS/LMS are most exposed. The attack is network-reachable wherever the verification surface is exposed.
// Security patch - crypto/src/pqc/crypto/lms/HSSPublicKeyParameters.cs
internal static HssPublicKeyParameters Parse(BinaryReader binaryReader)
{
int L = BinaryReaders.ReadInt32BigEndian(binaryReader);
+ if (L < 1 || L > 8) // RFC 8554, Section 6.
+ throw new InvalidDataException($"L value of HSS public key out of range: {L}");
+
LmsPublicKeyParameters lmsPublicKey = LmsPublicKeyParameters.Parse(binaryReader);
return new HssPublicKeyParameters(L, lmsPublicKey);
}
Source: bc-csharp commit f47ad47
Detection Methods for CVE-2026-103603
Indicators of Compromise
- Process crashes or restarts in .NET services with stack traces referencing Org.BouncyCastle.Pqc.Crypto.Lms.HssPublicKeyParameters.Parse or HssSignature.Parse.
- OutOfMemoryException events in application logs correlated with inbound signature verification requests.
- Sudden spikes in managed-heap allocation (multi-GB) on hosts performing HSS/LMS verification.
Detection Strategies
- Inventory .NET applications and dependencies to identify BouncyCastle.Cryptography package versions below 2.7.0.
- Instrument signature-verification code paths to log the parsed L value and reject any value greater than 8 before allocation.
- Monitor for inbound payloads containing HSS public key blobs where the first 4 bytes decode to a value outside the 1–8 range.
Monitoring Recommendations
- Alert on process memory pressure thresholds (for example, working set exceeding 4 GB) on services that handle untrusted cryptographic input.
- Correlate web application firewall logs with crash telemetry from endpoints to identify attempted exploitation patterns.
- Track dependency inventories through software composition analysis to detect reintroduction of vulnerable bc-csharp versions.
How to Mitigate CVE-2026-103603
Immediate Actions Required
- Upgrade BouncyCastle.Cryptography to version 2.7.0 or later across all .NET projects.
- Audit application code for direct calls into HssPublicKeyParameters.Parse and HssSignature.Parse and gate them with input-size limits.
- Restrict exposure of HSS/LMS verification endpoints to authenticated clients where feasible until patching completes.
Patch Information
The fix is published in bc-csharp 2.7.0 via commit f47ad47c7b5745b53d3f9ac711a5a419a272a5d7. The patch validates that L falls within the RFC 8554 range of 1 to 8 before any allocation and ensures no extra bytes follow a parsed HSS public key. See the CVE-2026-103603 wiki entry for vendor details.
Workarounds
- Enforce a maximum request body size on endpoints that accept HSS public keys and signatures to reduce memory pressure.
- Pre-validate the first four bytes of any HSS public key blob and reject values outside 1–8 before passing data to the parser.
- Run verification workloads in sandboxed processes with constrained memory limits so crashes do not affect the parent service.
# Update the Bouncy Castle package to the fixed release
dotnet add package BouncyCastle.Cryptography --version 2.7.0
# Verify no vulnerable versions remain in the solution
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

