Intelligence
criticalVulnerabilityActive

OpenDJ JMX RMI Pre-Authentication Deserialization RCE - Defensive Analysis

OpenDJ's JMX RMI connector deserializes untrusted data before authentication, enabling unauthenticated RCE via malicious serialized objects. This PoC validates a critical pre-auth bypass affecting all versions through 5.1.0.

S
Sebastion

CVE References

Affected

OpenDJ Community Edition <=5.1.0

Vulnerability Analysis

Root Cause & Classification: This vulnerability stems from CWE-502 (Deserialization of Untrusted Data) in OpenDJ's JMX RMI connector. The platform processes and deserializes attacker-controlled Java objects on the RMI stream before enforcing authentication checks. This violates secure design principles where authentication must precede any untrusted data processing. The vulnerability is particularly severe because JMX RMI is a legitimate administrative protocol, making it difficult to distinguish malicious from benign traffic.

PoC Significance: The disclosed PoC demonstrates practical exploitation against OpenDJ 4.4.15 with JDK 11 and Jackson 2.12.6.1, proving that gadget chains exist in common classpath libraries. The PoC's significance lies in proving the authentication bypass—any attacker with network access to the JMX RMI listener (default disabled but frequently enabled in monitoring deployments) can trigger deserialization without credentials. This is not theoretical; it shows the vulnerability window opens immediately upon connection.

Detection Guidance: Monitor for:

  • Inbound connections to JMX RMI ports (default 9010 for OpenDJ, or custom if configured) from untrusted sources
  • Log indicators: Look for JMX connector startup messages and unexpected RMI registry activity
  • Network signatures: Detect RMI protocol headers (JRMI) followed by serialization magic bytes (0xACED0005) in unauthenticated sessions
  • Host-based: Monitor OpenDJ process for child process spawning, unexpected network connections, or elevated privilege operations following JMX listener startup
  • Enable JMX audit logging (if available) to capture connection attempts and deserialization events

Mitigation Steps:

  1. Immediate: Disable JMX Connection Handler if not required: remove or comment out JMX listener configuration in config.ldif
  2. Network-level: Restrict TCP access to JMX listener ports to trusted management networks using firewall rules; never expose JMX to untrusted networks
  3. Patching: Upgrade to OpenDJ Community Edition 5.1.1 or later
  4. Classpath Hardening: Audit and minimize gadget chain libraries (Jackson, JNDI-enabled libraries) in OpenDJ's classpath if patching is delayed
  5. Runtime: Consider running OpenDJ with Java serialization filters (jdk.serialFilter property) to allowlist safe classes

Risk Assessment: This vulnerability has high likelihood of exploitation in the wild due to: (1) unauthenticated access requirement, (2) frequent JMX enablement in enterprise monitoring stacks (Nagios, Zabbix, Prometheus exporters), (3) stable PoC availability, and (4) zero user interaction required. Nation-state and sophisticated threat actors heavily target Java deserialization flaws for persistent RCE. Organizations running OpenDJ in identity/access management roles face critical risk, as OpenDJ compromise enables lateral movement and credential theft.