Advisory

Critical deserialization flaw in Apache ActiveMQ NMS AMQP client enables remote code execution

Take action: If you're using Apache ActiveMQ NMS AMQP Client (any version up to 2.3.0), update ASAP to version 2.4.0 or later, since a connection to a malicious servers can execute code on your systems. Only connect to trusted AMQP servers, and if you can't update right away, avoid connecting to any external or untrusted message brokers until you patch.


Learn More

A critical vulnerability is reported in the Apache ActiveMQ NMS AMQP Client that allows malicious AMQP servers to execute arbitrary code on vulnerable client applications. 

The vulnerability is tracked as CVE-2025-54539 (CVSS v3.1 score 9.8) and is caused by stems from improper deserialization of untrusted data received from AMQP servers. The client's deserialization logic fails to adequately verify the trustworthiness and safety of incoming data, relying instead on .NET binary serialization—a legacy mechanism that Microsoft is phasing out in the upcoming .NET 9 release due to inherent security concerns.

When a client application establishes a connection to an untrusted or compromised AMQP server, the server can send specially crafted responses that exploit the client's unbounded deserialization routines. These malicious payloads are designed to trigger arbitrary code execution on the client side, effectively allowing the attacker to take complete control of the client application. The vulnerability can be exploited simply by connecting to a hostile AMQP server, meaning that even organizations with hardened network perimeters remain vulnerable if their applications interact with malicious or compromised brokers.

Although version 2.1.0 of the NMS AMQP Client introduced an allow/deny list feature designed to restrict deserialization and prevent unsafe types from being processed, researchers at Endor Labs who discovered the vulnerability demonstrated that these protection mechanisms could be bypassed, rendering the defense ineffective. 

All versions of Apache ActiveMQ NMS AMQP Client through version 2.3.0 are affected by this vulnerability. This includes all releases prior to and including version 2.3.0 when establishing connections to untrusted AMQP servers.

Apache ActiveMQ has released the patched version 2.4.0 of the NMS AMQP Client. This version rejects untrusted types by default and incorporates stricter validation checks to prevent exploitation.

Organizations are strongly encouraged to upgrade to version 2.4.0 or later immediately to mitigate this vulnerability. As a long-term hardening strategy, projects that rely heavily on .NET binary serialization should begin planning migration to safer serialization frameworks such as JSON or protocol buffers to eliminate lingering attack surfaces. 

Critical deserialization flaw in Apache ActiveMQ NMS AMQP client enables remote code execution