CVE-2026-17507: CWE-195 Signed to Unsigned Conversion Error in Legion of the Bouncy Castle Inc. BC-JAVA
In Bouncy Castle for Java before 1.86, the MLS implementation (org.bouncycastle.mls) holds RFC 9420's uint32 leaf_index in a signed int, so a wire value with the top bit set decodes to a negative number. That is a legitimate encoding rather than malformed input, and it must still decode, since the MLS interop test vectors round-trip the full range. GroupKeySet.SecretTree.hasLeaf and Group.validateRemove compared the decoded value directly against the tree's leaf count, and a signed comparison treats any negative int as less than a positive bound, so an out-of-range sender passed the membership check. In the hasLeaf case the SenderData of an unprotected PrivateMessage could then drive LeafIndex.directPath through NodeIndex.parent() arithmetic that never reaches the tree root, growing the resulting node list without bound until the JVM exhausted its heap. A single small message from any current group member could therefore deny service to every other member of the group. Both comparisons now interpret the value as unsigned via Integer.toUnsignedLong, rejecting an out-of-range sender however it was encoded; well-formed leaf indices are unaffected.
AI Analysis
Technical Summary
The vulnerability in Bouncy Castle's Java MLS implementation arises because the uint32 leaf_index defined in RFC 9420 is stored in a signed int. When the top bit is set, the decoded value becomes negative, which is legitimate encoding but mishandled by membership checks in GroupKeySet.SecretTree.hasLeaf and Group.validateRemove. These checks use signed comparisons, allowing out-of-range senders to pass membership validation. This leads to unbounded growth in node lists during PrivateMessage processing, exhausting JVM heap memory and causing denial of service. The fix involves using Integer.toUnsignedLong to treat the leaf_index as unsigned, correctly rejecting invalid senders without affecting valid indices.
Potential Impact
An attacker who is a member of a current group can send a specially crafted small message that triggers unbounded memory allocation in the JVM of other group members, causing denial of service. This impacts availability of the MLS group communication. There is no indication of privilege escalation, data disclosure, or code execution. No known exploits are reported in the wild.
Mitigation Recommendations
A fix is available in Bouncy Castle Java library version 1.86 and later, which correctly interprets the leaf_index as unsigned and rejects out-of-range senders. Users should upgrade to version 1.86 or newer to remediate this vulnerability. No other mitigation is indicated.
CVE-2026-17507: CWE-195 Signed to Unsigned Conversion Error in Legion of the Bouncy Castle Inc. BC-JAVA
Description
In Bouncy Castle for Java before 1.86, the MLS implementation (org.bouncycastle.mls) holds RFC 9420's uint32 leaf_index in a signed int, so a wire value with the top bit set decodes to a negative number. That is a legitimate encoding rather than malformed input, and it must still decode, since the MLS interop test vectors round-trip the full range. GroupKeySet.SecretTree.hasLeaf and Group.validateRemove compared the decoded value directly against the tree's leaf count, and a signed comparison treats any negative int as less than a positive bound, so an out-of-range sender passed the membership check. In the hasLeaf case the SenderData of an unprotected PrivateMessage could then drive LeafIndex.directPath through NodeIndex.parent() arithmetic that never reaches the tree root, growing the resulting node list without bound until the JVM exhausted its heap. A single small message from any current group member could therefore deny service to every other member of the group. Both comparisons now interpret the value as unsigned via Integer.toUnsignedLong, rejecting an out-of-range sender however it was encoded; well-formed leaf indices are unaffected.
CVSS v4.0
Score 8.7high
Affected software
Legion of the Bouncy Castle Inc.
BC-JAVA
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Bouncy Castle's Java MLS implementation arises because the uint32 leaf_index defined in RFC 9420 is stored in a signed int. When the top bit is set, the decoded value becomes negative, which is legitimate encoding but mishandled by membership checks in GroupKeySet.SecretTree.hasLeaf and Group.validateRemove. These checks use signed comparisons, allowing out-of-range senders to pass membership validation. This leads to unbounded growth in node lists during PrivateMessage processing, exhausting JVM heap memory and causing denial of service. The fix involves using Integer.toUnsignedLong to treat the leaf_index as unsigned, correctly rejecting invalid senders without affecting valid indices.
Potential Impact
An attacker who is a member of a current group can send a specially crafted small message that triggers unbounded memory allocation in the JVM of other group members, causing denial of service. This impacts availability of the MLS group communication. There is no indication of privilege escalation, data disclosure, or code execution. No known exploits are reported in the wild.
Mitigation Recommendations
A fix is available in Bouncy Castle Java library version 1.86 and later, which correctly interprets the leaf_index as unsigned and rejects out-of-range senders. Users should upgrade to version 1.86 or newer to remediate this vulnerability. No other mitigation is indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- bcorg
- Date Reserved
- 2026-07-26T22:40:20.567Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abf5de5a43b0b3b8988e878
Added to database: 10/02/2026, 07:31:49 UTC
Last enriched: 10/02/2026, 07:46:49 UTC
Last updated: 10/03/2026, 04:45:56 UTC
Views: 15
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.