GHSA-6g32-pxv4-2wfj: Maven/com.rabbitmq:amqp-client vulnerability
The JSON-RPC tools in com.rabbitmq.tools.jsonrpc perform Class.forName(javaReturnType) with initialize=true on class names received from untrusted AMQP messages, without any validation or allowlist.
Vulnerable code (ProcedureDescription.java:101-127): When a JsonRpcClient connects, it calls system.describe and receives a service description from the AMQP queue. The response JSON includes javaReturnType fields that are reflectively set via JSONUtil.tryFill(), triggering setJavaReturnType() → computeReturnTypeAsJavaClass() → Class.forName(javaReturnType).
Attack scenario: 1. Victim uses JsonRpcClient to connect to a JSON-RPC service via RabbitMQ 2. Attacker (co-tenant on shared broker, or MITM) intercepts the system.describe request 3. Attacker responds with crafted javaReturnType values 4. Victim's client calls Class.forName(attackerInput) with default initialize=true 5. Static initializers of attacker-specified classes execute in victim's JVM
Additionally, the loaded class from getReturnType() is passed to mapper.parse(replyStr, expectedType) at JsonRpcClient.java:168, potentially enabling type-confusion.
Recommended fix: Use Class.forName(javaReturnType, false, classLoader) to prevent static initializer execution, or add an allowlist of permitted return types.
CWE: CWE-470
---
Reply from reporter (2026-06-29): Thanks for the quick turnaround. Fix looks good. Looking forward to the CVE assignment.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/com.rabbitmq:amqp-clientto a version that resolves this vulnerability.Fixed in 5.33.0 - Configuration
Change the Class.forName call used on untrusted javaReturnType values from initialize=true (default) to initialize=false by using Class.forName(javaReturnType, false, classLoader) to prevent static initializer execution.
Java JSON-RPC tools (com.rabbitmq.tools.jsonrpc) Class.forName(javaReturnType, true/false, classLoader) initialize flag = false - Configuration
Add an allowlist (validation) of permitted return types for javaReturnType values received from untrusted AMQP messages before calling computeReturnTypeAsJavaClass() / Class.forName(javaReturnType), to prevent attacker-controlled type confusion and class loading.
Java JSON-RPC tools (com.rabbitmq.tools.jsonrpc) Return type validation / allowlist for javaReturnType = allowlist - Compensating control
Add an external validation/constraint at the broker/AMQP layer so the victim cannot retrieve attacker-controlled service descriptions for system.describe from the shared broker (e.g., isolate queues/permissions for com.rabbitmq.tools.jsonrpc service discovery so only trusted services can respond).
Event History
Frequently Asked Questions
Who is realistically exposed?
Clients using JsonRpcClient are exposed when they connect to a JSON-RPC service through RabbitMQ and an attacker can intercept or provide the response to the client's system.describe request. The described attacker positions are a co-tenant on a shared broker or a man-in-the-middle.
What does an attacker need to exploit this?
The attacker needs to control or intercept the AMQP response to system.describe and supply crafted javaReturnType values in the returned service description. No validation or allowlist is applied before the client loads the specified class.
What happens on a successful exploit?
The vulnerable Class.forName call uses initialize=true, so static initializers in attacker-specified classes execute in the victim JVM when the class is loaded. The resulting class is also used as the expected type when parsing a reply, which can create type-confusion risk.