/

CVE-2026-33728

Severity:

CRITICAL RISK

(9.8)

Unsafe RMI Deserialization (CWE-502) in dd-trace-java RMI Instrumentation

CVE-2026-33728

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution over JMX/RMI

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

dd-trace-java's RMI instrumentation in affected versions deserializes data from a custom RMI/JMX endpoint without applying serialization filters on JDK 16 and earlier.

With network access to the exposed JMX/RMI port and a suitable gadget chain on the classpath, an attacker could potentially achieve remote code execution on the instrumented JVM.

Affected context

This vulnerability affects JVMs running dd-trace-java as a Java agent (-javaagent) on JDK 16 or earlier where:

  • A JMX/RMI port is explicitly enabled (e.g., via -Dcom.sun.management.jmxremote.port)
  • That port is reachable from an attacker-controlled network segment
  • Application or framework libraries on the classpath expose gadget chains exploitable via Java deserialization

The custom RMI endpoint registered by the dd-trace-java instrumentation becomes part of the remotely reachable attack surface in these conditions.

Exploit preconditions

  • Attack surface: Exposed JMX/RMI management interface on the instrumented JVM.
  • Required access: Network-level access to the configured JMX/RMI port; no application-level authentication is assumed for the vulnerable deserialization path.
  • Execution environment:
  • dd-trace-java attached as a Java agent on JDK <= 16
  • JMX/RMI port configured via -Dcom.sun.management.jmxremote.port
  • Gadget-chain-compatible classes present on the application classpath.
  • Trigger point: Sending crafted serialized objects to the custom RMI endpoint introduced by the instrumentation.
  • Why exploitation is possible: Incoming serialized data is deserialized without serialization filters or robust validation, allowing attacker-controlled object graphs to be instantiated and gadget chains to be executed.

Why this happens

The root cause is an unsafe deserialization pattern introduced by the RMI instrumentation in dd-trace-java.

The instrumentation registers a custom endpoint that deserializes data received over RMI/JMX using the standard Java serialization mechanism but does not apply serialization filters or a strict allowlist of types.

This aligns with CWE-502: Deserialization of Untrusted Data, where attacker-controlled serialized streams are processed as trusted objects, enabling the construction of malicious object graphs that trigger code execution through existing libraries (gadget chains).

Potential impact

  • Remote execution of arbitrary Java or operating system commands within the JVM process.
  • Full compromise of the instrumented application, including access to in-memory data and credentials.
  • Lateral movement to other systems reachable from the compromised JVM.
  • Manipulation or disablement of application monitoring and telemetry data.
  • Use of the compromised JVM as a pivot for broader network intrusion.

General mitigation guidance

Effective mitigation centers on reducing trust in serialized inputs and minimizing exposed management surfaces:

  • Prefer runtimes and configurations that enforce serialization filtering (e.g., JDKs with built-in ObjectInputFilter support) and apply strict allowlists for classes that may be deserialized.
  • Limit or disable RMI/JMX endpoints in production whenever practical, especially when they are reachable from untrusted networks.
  • Segment network access so that management ports (JMX/RMI) are only reachable from tightly controlled administration networks.
  • Minimize gadget availability by avoiding unnecessary libraries on the classpath and removing legacy or unused components prone to deserialization gadgets.
  • Run instrumented JVMs with least privilege (OS user permissions, restricted filesystem and network access) so that, if deserialization is abused, the impact is constrained.
  • Consider alternative monitoring and management mechanisms that do not rely on Java native serialization over remote endpoints.

How teams detect issues like this

Detection can combine code, configuration, and runtime monitoring approaches:

  • Static analysis:
  • Search for use of Java native deserialization APIs (ObjectInputStream, RMI/JMX invocation handlers) that process network data without ObjectInputFilter or equivalent checks.
  • Flag custom RMI or JMX endpoints that accept arbitrary serialized payloads.
  • Configuration review:
  • Inventory JVMs with dd-trace-java attached and verify JMX/RMI port settings and exposure.
  • Check for lack of access controls or filtering on management endpoints.
  • Runtime and network monitoring:
  • Monitor network traffic to JMX/RMI ports for unusual or large serialized payloads.
  • Use intrusion detection systems capable of recognizing Java deserialization exploit patterns.
  • Policy enforcement:
  • Enforce CI/CD policies that require serialization filtering for any use of Java serialization on network-exposed paths.
  • Integrate automated code review tools that highlight unsafe deserialization patterns and insecure RMI/JMX exposure.

Sources

SourceLink
github.comgithub.com/DataDog/dd-trace-java/releases/tag/v1.60.3
github.comgithub.com/DataDog/dd-trace-java/security/advisories/GHSA-579q-h82j-r5v2

Frequently asked

questions

It can be, but only if the JMX/RMI port of an instrumented JVM is exposed to an attacker-controlled network (for example, directly or via misconfigured load balancers or firewalls). In many deployments, JMX/RMI ports are intended to be internal-only, but misconfiguration can make them externally reachable.

The attacker needs network-level access to the configured JMX/RMI port on a JVM where dd-trace-java is attached as a Java agent on JDK 16 or earlier, and the application must have gadget-compatible libraries on the classpath. No additional application-layer credentials are inherently required for the vulnerable deserialization step itself.

The general fix pattern is to avoid deserializing untrusted data over remote management channels. Where native serialization cannot be removed, apply strict serialization filters or allowlists, and ensure RMI/JMX endpoints are not exposed to untrusted networks. Disabling non-essential RMI integrations and restricting management interfaces to trusted administrative networks significantly reduces risk.

Organizations can prevent similar vulnerabilities by banning or tightly controlling Java native deserialization for remotely supplied data, systematically applying ObjectInputFilter or equivalent mechanisms, and favoring safer data formats (such as JSON or protobuf) for remote communication. Additionally, applying secure defaults for APM and monitoring agents, performing regular reviews of exposed management ports, and incorporating automated checks for unsafe deserialization in CI/CD pipelines help catch these patterns early in development and deployment.

Find out what's already
exploitable in your codebase.