The vulnerability, identified as CVE-2025-53393, is a classic case of Deserialization of Untrusted Data (CWE-502) within the akka-cluster-metrics module. The root cause is the use of standard Java serialization as a fallback mechanism for handling specific numeric types (BigInt, BigDecimal) within the cluster metrics protocol.
The analysis of the patch commit d69a082abfa26ccc076f090a6486ccfee9d7c481 reveals two key functions involved in this process:
-
akka.cluster.metrics.protobuf.MessageSerializer.numberToProto: This function was responsible for serializing metric values. For unhandled number types, it would use ObjectOutputStream.writeObject, creating a serialized Java object. This is the serialization side of the vulnerability.
-
akka.cluster.metrics.protobuf.MessageSerializer.protoToNumber: This function was responsible for deserializing the metrics on a receiving node. When it encountered a metric value of type Serialized, it would use ObjectInputStream.readObject to reconstruct the Java object from the byte stream. This is the deserialization sink, where a malicious payload would be executed.
An attacker with the ability to send messages within the Akka cluster could craft a malicious MetricsGossipEnvelope containing a serialized Java object gadget chain. When the victim node's protoToNumber function deserializes this payload, it would trigger the gadget chain, leading to potential remote code execution. The patch mitigates this by adding explicit handling for BigInt and BigDecimal types, converting them to standard primitive types (long, double) before serialization and disabling the unsafe Java serialization path by default.