CVE-2026-59395
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring AMQP applies core Spring concepts to the development of AMQP-based messaging solutions, providing a template for sending and receiving messages and listener containers that deliver messages to annotated @RabbitListener methods.
An authorization bypass vulnerability (CVE-2026-59395) has been identified in the SimpleAmqpHeaderMapper of Spring AMQP, which allows attackers who can publish messages to a listener's queue to replace trusted framework headers such as amqp_receivedUserId and amqp_consumerQueue with values of their choosing. Applications that use these headers for authorization or routing decisions can be misled into treating a message as coming from another user or queue.
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 AMQP.
Details
Module Info
- Product: Spring AMQP
- Affected packages:
org.springframework.amqp:spring-amqp - Affected versions: >=4.1.0 <=4.1.2, >=4.0.0 <=4.0.6, >=3.2.0 <=3.2.13, <=2.4.19
- GitHub repository: https://github.com/spring-projects/spring-amqp
- Published packages: https://central.sonatype.com/artifact/org.springframework.amqp/spring-amqp
- Package manager: Maven
- Fixed in:
- OSS Spring AMQP 4.0.7, 4.1.3
- NES for Spring AMQP
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework.amqp:spring-amqp package in multiple versions of Spring AMQP.
When a listener receives a message, SimpleAmqpHeaderMapper.toHeaders() converts the AMQP MessageProperties into Spring Messaging headers. It first fills the header map with framework-derived values taken from the MessageProperties getters, such as amqp_receivedUserId (the broker-validated user id), amqp_consumerQueue, amqp_deliveryTag and amqp_redelivered. It then copies the raw AMQP headers table of the message on top of that map without any filtering:
.acceptIfHasText(AmqpHeaders.RECEIVED_USER_ID, amqpMessageProperties.getReceivedUserId(),
putString)
.acceptIfHasText(AmqpHeaders.CONSUMER_TAG, amqpMessageProperties.getConsumerTag(), putString)
.acceptIfHasText(AmqpHeaders.CONSUMER_QUEUE, amqpMessageProperties.getConsumerQueue(), putString);
headers.put(AmqpHeaders.LAST_IN_BATCH, amqpMessageProperties.isLastInBatch());
headers.put(AmqpHeaders.RETRY_COUNT, amqpMessageProperties.getRetryCount());
// Map custom headers
headers.putAll(amqpMessageProperties.getHeaders());Older lines perform the same unfiltered copy with a loop that calls headers.put(entry.getKey(), entry.getValue()) for every entry of amqpMessageProperties.getHeaders().
The AMQP headers table is fully controlled by the publisher. A publisher can therefore add custom headers whose names collide with the AmqpHeaders constants, for example amqp_receivedUserId or amqp_consumerQueue. Because the custom headers are copied last, these values silently replace the framework-derived ones, or inject them when the corresponding property was absent. A @RabbitListener handler that reads @Header(AmqpHeaders.RECEIVED_USER_ID) or inspects MessageHeaders then sees the attacker-supplied value instead of the identity validated by the broker or the queue the message was actually consumed from, which can defeat authorization or routing decisions based on those headers.
Mitigation
Only recent versions of Spring AMQP 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 AMQP.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.