CVE-2021-42550 Overview
CVE-2021-42550 is an insecure deserialization vulnerability affecting Logback, a popular Java logging framework. In Logback version 1.2.7 and prior versions, an attacker with the required privileges to edit configuration files could craft a malicious configuration that allows execution of arbitrary code loaded from LDAP servers. This vulnerability is particularly concerning given Logback's widespread adoption in Java-based enterprise applications and is related to the broader class of JNDI injection vulnerabilities that gained significant attention following Log4Shell.
Critical Impact
Privileged attackers who can modify Logback configuration files can achieve remote code execution by injecting malicious JNDI/LDAP references, potentially leading to complete system compromise.
Affected Products
- QOS Logback (versions up to 1.2.7 and 1.3.0-alpha0 through 1.3.0-alpha10)
- Red Hat Satellite 6.0
- NetApp Cloud Manager
- NetApp Service Level Manager
- NetApp Snap Creator Framework
- Siemens SINEC NMS
Discovery Timeline
- December 16, 2021 - CVE-2021-42550 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2021-42550
Vulnerability Analysis
This vulnerability falls under CWE-502 (Deserialization of Untrusted Data) and enables remote code execution through JNDI injection. The attack requires an adversary to have write access to Logback configuration files (logback.xml or similar), making it a post-authentication or insider threat scenario. However, in environments where configuration files are managed through insecure channels, dynamically loaded, or accessible via other vulnerabilities, the attack surface expands significantly.
The vulnerability exploits Logback's support for JNDI lookups in configuration files. When a malicious configuration containing an LDAP reference is processed, Logback connects to the attacker-controlled LDAP server, which can return a serialized Java object. Upon deserialization, arbitrary code execution occurs on the victim system. This attack pattern is similar to the infamous Log4Shell vulnerability (CVE-2021-44228), though it requires configuration file access rather than log message injection.
Root Cause
The root cause stems from Logback's handling of JNDI lookups in configuration files without adequate restrictions or validation. When processing configuration elements that support JNDI references, Logback performs lookups against external naming services (including LDAP) without implementing security controls to prevent loading and executing arbitrary code from remote sources. The framework's design allowed Java object references to be returned from LDAP servers and automatically deserialized, creating a code execution vector.
Attack Vector
Exploitation requires network access and elevated privileges—specifically, the ability to modify Logback configuration files. The attack proceeds in several stages:
- The attacker gains write access to a Logback configuration file through either legitimate access, exploitation of another vulnerability, or compromise of configuration management systems
- A malicious JNDI reference pointing to an attacker-controlled LDAP server is inserted into the configuration (e.g., within a JMSAppender or similar element)
- When the application loads or reloads the configuration, it performs a JNDI lookup to the malicious LDAP server
- The LDAP server responds with a reference to a malicious Java class
- The application deserializes and instantiates the malicious class, executing attacker-controlled code
The attack complexity is considered high due to the prerequisite of configuration file access, and no user interaction is required once the malicious configuration is in place. A successful exploit can result in complete confidentiality, integrity, and availability compromise of the affected system.
For technical demonstration details, see the GitHub Logback RCE Demo repository.
Detection Methods for CVE-2021-42550
Indicators of Compromise
- Unexpected modifications to logback.xml or logback-spring.xml configuration files
- Configuration entries containing JNDI references with ldap://, rmi://, or ldaps:// protocols pointing to external addresses
- Outbound network connections from Java applications to unknown LDAP or RMI servers on non-standard ports
- Presence of unfamiliar Java class files or JAR files in application directories
- Application logs showing JNDI lookup errors or connections to external naming services
Detection Strategies
- Implement file integrity monitoring (FIM) on all Logback configuration files to detect unauthorized modifications
- Monitor network traffic for outbound LDAP/RMI connections from application servers, especially to external IP addresses
- Deploy runtime application self-protection (RASP) solutions to detect and block suspicious JNDI lookups
- Review application logs for JNDI-related exceptions or connection attempts to unexpected hosts
- Use SentinelOne's behavioral AI to identify anomalous process spawning from Java applications
Monitoring Recommendations
- Configure alerts for any write operations to Logback configuration files outside of approved deployment windows
- Establish baseline network behavior for Java applications and alert on deviations, particularly outbound connections to LDAP servers
- Monitor Java process behavior for unexpected child process creation or network connections
- Implement centralized logging aggregation to correlate configuration changes with subsequent suspicious activity
- Enable SentinelOne Singularity Platform's automated threat detection for Java-based attack patterns
How to Mitigate CVE-2021-42550
Immediate Actions Required
- Upgrade Logback to version 1.2.8 or later (for 1.2.x branch) or 1.3.0-alpha11 or later (for 1.3.x branch) immediately
- Audit and restrict write permissions to all Logback configuration files to only authorized deployment processes
- Review existing Logback configurations for any suspicious JNDI references or unexpected LDAP/RMI URLs
- Implement network segmentation to prevent application servers from making outbound LDAP connections to untrusted hosts
- Enable SentinelOne's Singularity XDR for comprehensive endpoint protection against code execution attempts
Patch Information
The QOS development team addressed this vulnerability in Logback version 1.2.8 and version 1.3.0-alpha11. The patches implement restrictions on JNDI lookups in configuration files, preventing the loading of arbitrary code from remote servers. Organizations should prioritize upgrading to these patched versions. Detailed patch information is available in the JIRA Logback Issue LOGBACK-1591 and Logback News Updates.
For affected third-party products, consult vendor-specific advisories:
Workarounds
- Restrict file system permissions on Logback configuration files to read-only for application runtime users
- Implement application-level configuration validation to reject configurations containing JNDI references
- Use network firewalls or egress filtering to block outbound LDAP and RMI connections from application servers
- Consider containerization with read-only file systems to prevent runtime configuration modifications
- Deploy Java Security Manager policies to restrict JNDI lookups (note: Security Manager is deprecated in newer Java versions)
# Restrict logback.xml permissions (Linux/Unix)
chmod 444 /path/to/application/logback.xml
chown root:root /path/to/application/logback.xml
# Block outbound LDAP connections at the firewall (iptables example)
iptables -A OUTPUT -p tcp --dport 389 -j DROP
iptables -A OUTPUT -p tcp --dport 636 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


