The analysis of the security vulnerability CVE-2025-54539 in the Apache ActiveMQ NMS AMQP client reveals a critical flaw in the deserialization process, which could be exploited for remote code execution. The vulnerability stems from a bypass in the allow/deny list mechanism designed to control which types can be deserialized.
The root cause is a two-part logic flaw. First, the TrustedClassFilter.BindToType method, which is supposed to resolve type names from a serialized stream, did not properly handle cases where a type could not be found. It would pass a null Type object down the line instead of raising an error. Second, the NmsDefaultDeserializationPolicy.IsTrustedType method, which checks if a type is trusted, had a critical error where it would consider a null type as trusted (return true).
An attacker could craft a malicious AMQP message containing a serialized object with manipulated type information. This would cause BindToType to fail to resolve the type and return null. This null value would then be passed to IsTrustedType, which would incorrectly approve it, allowing the deserialization of the untrusted, and potentially malicious, object. The provided patch addresses both of these flaws by adding a null check in BindToType and changing the logic in IsTrustedType to correctly deny null types. Both functions are central to the vulnerability and would be observed in a runtime trace during an exploit.