CVE-2026-59391
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Framework is the foundational Java application framework of the Spring ecosystem, providing dependency injection, transaction management, web and messaging support. Its spring-messaging module supplies the STOMP support used by WebSocket messaging applications, including a broker relay that forwards STOMP frames to an external STOMP message broker.
An authorization bypass vulnerability (CVE-2026-59391) has been identified in the STOMP broker relay of Spring Framework, which allows authenticated attackers to smuggle STOMP frames to an external broker and have it process commands that Spring Security message authorization rules would otherwise deny. This can let an attacker send or receive messages on restricted destinations.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.
This issue affects multiple versions of Spring Framework.
Details
Module Info
- Product: Spring Framework
- Affected packages:
org.springframework:spring-messaging - Affected versions: >=7.0.0 <=7.0.10, >=6.2.0 <=6.2.20, >=6.1.0 <=6.1.29, >=6.0.0 <=6.0.32, >=5.3.0 <=5.3.50, <=5.2.26.RELEASE
- GitHub repository: https://github.com/spring-projects/spring-framework
- Published packages: https://central.sonatype.com/artifact/org.springframework/spring-messaging
- Package manager: Maven
- Fixed in:
- OSS Spring Framework 7.0.11
- NES for Spring Framework
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework:spring-messaging package in multiple versions of Spring Framework. An application is affected when it uses the STOMP broker relay with an external broker and relies on Spring Security message authorization to restrict access to destinations.
When a client sends a STOMP frame, the application authorizes it and then StompBrokerRelayMessageHandler re-encodes it with StompEncoder and writes it to the external broker. While writing the frame headers, StompEncoder.writeHeaders only discards a client-supplied content-length header for commands that require one (SEND, MESSAGE and ERROR), and then writes the correct value itself:
for (Entry<String, List<String>> entry : nativeHeaders.entrySet()) {
if (command.requiresContentLength() && "content-length".equals(entry.getKey())) {
continue;
}
// ... the header key and values are encoded into the outgoing frame
}
if (command.requiresContentLength()) {
int contentLength = payload.length;
result.add("content-length:".getBytes(StandardCharsets.UTF_8));
result.add(Integer.toString(contentLength).getBytes(StandardCharsets.UTF_8));
result.add(LINE_FEED_BYTE);
}For every other command, such as SUBSCRIBE, the attacker's content-length header is passed through to the broker unchanged, even though it does not describe the frame that is actually sent. The external broker trusts that value when it reads the frame body, so a crafted length makes it misjudge where the frame ends and parse the remaining bytes as additional STOMP frames. Those smuggled frames never pass through the application's message authorization checks, so the broker can act on SUBSCRIBE or SEND commands for destinations the attacker is not permitted to use.
Mitigation
Only recent versions of Spring Framework 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 Framework.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
Rajat Raghav (finder)