Skip to main content
EPSS 0.3%top 77%

CVE-2026-17507: CWE-195 Signed to Unsigned Conversion Error in Legion of the Bouncy Castle Inc. BC-JAVA

0
High
VulnerabilityCVE-2026-17507cvecve-2026-17507cwe-195
Published: 10/02/2026 (10/02/2026, 07:26:34 UTC)
Source: CVE Database V5
Vendor/Project: Legion of the Bouncy Castle Inc.
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/U:Amber

Affected software

Legion of the Bouncy Castle Inc.

BC-JAVA

Affected versions
>=1.73 <1.86
GitHub Actionsmore threats →cve
bcmls
pkg:github/bcmls
Affected versions
>=1.73 <1.86

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/02/2026, 07:46:49 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses