CVE-2026-59331

Denial of Service
Affects
Spring Security
in
Spring
No items found.
Versions
>=5.7.0 <=5.7.26, >=5.8.0 <=5.8.28, >=6.0.0 <=6.4.19, >=6.5.0 <=6.5.12, >=7.0.0 <=7.0.8, >=7.1.0 <=7.1.2

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring Security is a framework that provides authentication, authorization, and protection against common attacks for Java applications, including reactive RSocket applications through its spring-security-rsocket module.

A denial of service vulnerability (CVE-2026-59331) has been identified in Spring Security's RSocket Basic Authentication support, which allows unauthenticated attackers to exhaust server memory with a single crafted authentication frame.

Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.

This issue affects multiple versions of Spring Security.

‍

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the spring-security-rsocket package in multiple versions of Spring Security. Its CVSS 3.1 base score is 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

BasicAuthenticationPayloadExchangeConverter extracts the message/x.rsocket.authentication.basic.v0 entry from an RSocket frame's composite metadata and decodes it with BasicAuthenticationDecoder. The metadata is encoded as a 4-byte big-endian username length, followed by the username bytes and then the password bytes. The decoder trusts the length field and uses it directly to size an allocation:

return Mono.from(input).map(DataBuffer::asByteBuffer).map((byteBuffer) -> {
	int usernameSize = byteBuffer.getInt();
	byte[] usernameBytes = new byte[usernameSize];
	byteBuffer.get(usernameBytes);
	byte[] passwordBytes = new byte[byteBuffer.remaining()];
	byteBuffer.get(passwordBytes);
	...
});

The value is never checked against the number of bytes actually present in the metadata, or for being negative. A frame whose length field is set to a value close to Integer.MAX_VALUE makes the server attempt an allocation of nearly 2 GB before it reads a single username byte, so a single crafted frame can exhaust available memory.

The converter runs before authentication. It is in effect whenever an AuthenticationPayloadInterceptor keeps its default authentication converter, for example with the deprecated RSocketSecurity#basicAuthentication configuration. Any client that can open a connection to the RSocket endpoint can therefore trigger the allocation without credentials, resulting in a denial of service.

‍

Mitigation

Only recent versions of Spring Security receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to a currently supported version of Spring Security.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

‍

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-59331
PROJECT Affected
Spring Security
Versions Affected
>=5.7.0 <=5.7.26, >=5.8.0 <=5.8.28, >=6.0.0 <=6.4.19, >=6.5.0 <=6.5.12, >=7.0.0 <=7.0.8, >=7.1.0 <=7.1.2
NES Versions Affected
Published date
November 20, 2026
≈ Fix date
Category
Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.