# CVE-2021-44228: Remote code injection in Log4j

> CVE-2021-44228 (GitHub advisory GHSA-jfh8-c2jp-5v3q) is a critical-severity vulnerability with a CVSS 3.1 base score of 10.0, classed as Improper Input Validation (CWE-20), in 5 packages, including org.apache.logging.log4j:log4j-core (Maven) and com.guicedee.services:log4j-core (Maven). Fixed versions: org.apache.logging.log4j:log4j-core 2.15.0, 2.12.2 or 2.3.1; org.ops4j.pax.logging:pax-logging-log4j2 1.9.2, 1.10.8, 1.11.10 or 2.0.11. CISA lists it as a known exploited vulnerability (added 10 Dec 2021).

Canonical page: https://cveminer.com/vulnerabilities/CVE-2021-44228

| Field | Value |
| --- | --- |
| CVE | CVE-2021-44228 |
| GHSA | GHSA-jfh8-c2jp-5v3q |
| Severity | Critical |
| CVSS 3.1 | 10.0 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:H` (GitHub Advisory Database) |
| CVSS 3.1 | 10.0 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H` (CVE.org) |
| CWE | CWE-20 Improper Input Validation; CWE-400 Uncontrolled Resource Consumption; CWE-502 Deserialization of Untrusted Data; CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') |
| EPSS | 99.99% (higher than 99.9% of CVEs) |
| CISA KEV | Listed 10 Dec 2021, due 24 Dec 2021 |
| SSVC | exploitation active, automatable yes, technical impact total |
| Published | 10 Dec 2021 |
| Modified | 22 Oct 2025 |

## Description

Log4j versions prior to 2.16.0 are subject to a remote code execution vulnerability via the ldap JNDI parser.
As per [Apache's Log4j security guide](https://logging.apache.org/log4j/2.x/security.html): Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.16.0, this behavior has been disabled by default.

Log4j version 2.15.0 contained an earlier fix for the vulnerability, but that patch did not disable attacker-controlled JNDI lookups in all situations. For more information, see the `Updated advice for version 2.16.0` section of this advisory.

### Impact

Logging untrusted or user controlled data with a vulnerable version of Log4J may result in Remote Code Execution (RCE) against your application. This includes untrusted data included in logged errors such as exception traces, authentication failures, and other unexpected vectors of user controlled input. 

### Affected versions

Any Log4J version prior to v2.15.0 is affected to this specific issue.

The v1 branch of Log4J which is considered End Of Life (EOL) is vulnerable to other RCE vectors so the recommendation is to still update to 2.16.0 where possible.

#### Security releases
Additional backports of this fix have been made available in versions 2.3.1, 2.12.2, and 2.12.3

#### Affected packages
Only the `org.apache.logging.log4j:log4j-core` package is directly affected by this vulnerability. The `org.apache.logging.log4j:log4j-api` should be kept at the same version as the `org.apache.logging.log4j:log4j-core` package to ensure compatability if in use.

### Remediation Advice

#### Updated advice for version 2.16.0

The Apache Logging Services team provided updated mitigation advice upon the release of version 2.16.0, which [disables JNDI by default and completely removes support for message lookups](https://logging.apache.org/log4j/2.x/changes-report.html#a2.16.0).
Even in version 2.15.0, lookups used in layouts to provide specific pieces of context information will still recursively resolve, possibly triggering JNDI lookups. This problem is being tracked as [CVE-2021-45046](https://nvd.nist.gov/vuln/detail/CVE-2021-45046). More information is available on the [GitHub Security Advisory for CVE-2021-45046](https://github.com/advisories/GHSA-7rjr-3q55-vv33).

Users who want to avoid attacker-controlled JNDI lookups but cannot upgrade to 2.16.0 must [ensure that no such lookups resolve to attacker-provided data and ensure that the the JndiLookup class is not loaded](https://issues.apache.org/jira/browse/LOG4J2-3221).

Please note that Log4J v1 is End Of Life (EOL) and will not receive patches for this issue. Log4J v1 is also vulnerable to other RCE vectors and we recommend you migrate to Log4J 2.16.0 where possible.

## Affected packages

| Package | Ecosystem | PURL | Vulnerable versions | Fixed in |
| --- | --- | --- | --- | --- |
| org.apache.logging.log4j:log4j-core | Maven | `pkg:maven/org.apache.logging.log4j/log4j-core` | >= 2.13.0, < 2.15.0; >= 2.4, < 2.12.2; >= 2.0-beta9, < 2.3.1 | 2.15.0, 2.12.2, 2.3.1 |
| com.guicedee.services:log4j-core | Maven | `pkg:maven/com.guicedee.services/log4j-core` | <= 1.2.1.2-jre17 | no fix |
| org.xbib.elasticsearch:log4j | Maven | `pkg:maven/org.xbib.elasticsearch/log4j` | = 6.3.2.1 | no fix |
| uk.co.nichesolutions.logging.log4j:log4j-core | Maven | `pkg:maven/uk.co.nichesolutions.logging.log4j/log4j-core` | = 2.6.3-CUSTOM | no fix |
| org.ops4j.pax.logging:pax-logging-log4j2 | Maven | `pkg:maven/org.ops4j.pax.logging/pax-logging-log4j2` | >= 1.8.0, < 1.9.2; >= 1.10.0, < 1.10.8; >= 1.11.0, < 1.11.10; >= 2.0.0, < 2.0.11 | 1.9.2, 1.10.8, 1.11.10, 2.0.11 |

## Fix commits

- Pull request: https://github.com/apache/logging-log4j2/pull/608
- Release: https://github.com/apache/logging-log4j2/commit/38513a7d57343881f7bf58f37e67d6a87e0a47c5 (2.3.1)
- Release: https://github.com/apache/logging-log4j2/commit/ad361d2e517e765f69db464d9407ac2dd80bc93e (2.12.2)
- Release: https://github.com/apache/logging-log4j2/commit/c30a1398a6697fb832c650870c44284d0052103e (2.15.0)

## Questions

**What is the GHSA ID for CVE-2021-44228?**

GitHub tracks CVE-2021-44228 as GHSA-jfh8-c2jp-5v3q.

**What is the CVSS score of CVE-2021-44228?**

CVE-2021-44228 has a CVSS 3.1 base score of 10.0 (Critical), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:H.

**Which versions are affected by CVE-2021-44228?**

org.apache.logging.log4j:log4j-core (Maven): >= 2.13.0, < 2.15.0; >= 2.4, < 2.12.2; >= 2.0-beta9, < 2.3.1. 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.ops4j.pax.logging:pax-logging-log4j2 (Maven): >= 1.8.0, < 1.9.2; >= 1.10.0, < 1.10.8; >= 1.11.0, < 1.11.10; >= 2.0.0, < 2.0.11.

**How do I fix CVE-2021-44228?**

Upgrade each package to its fixed version: org.apache.logging.log4j:log4j-core 2.15.0, 2.12.2 or 2.3.1; org.ops4j.pax.logging:pax-logging-log4j2 1.9.2, 1.10.8, 1.11.10 or 2.0.11. The fix is in pull request #608.

**What is the Package URL (PURL) for CVE-2021-44228?**

The affected packages' PURLs are pkg:maven/org.apache.logging.log4j/log4j-core, pkg:maven/com.guicedee.services/log4j-core, pkg:maven/org.xbib.elasticsearch/log4j, pkg:maven/uk.co.nichesolutions.logging.log4j/log4j-core and pkg:maven/org.ops4j.pax.logging/pax-logging-log4j2.

**Is CVE-2021-44228 exploited in the wild?**

CISA lists it as a known exploited vulnerability (added 10 Dec 2021). CISA's SSVC assessment rates exploitation as "active". EPSS estimates a 99.99% chance of exploitation in the next 30 days, higher than 99.9% of CVEs.

## References

- https://github.com/apache/logging-log4j2/pull/608 (fix)
- https://www.oracle.com/security-alerts/cpuapr2022.html (fix)
- https://www.oracle.com/security-alerts/cpujan2022.html (fix)
- https://msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2 (fix)
- https://nvd.nist.gov/vuln/detail/CVE-2021-44228 (advisory)
- https://github.com/github/advisory-database/pull/5501 (advisory)
- https://cert-portal.siemens.com/productcert/pdf/ssa-397453.pdf (advisory)
- https://packetstormsecurity.com/files/167794/Open-Xchange-App-Suite-7.10.x-Cross-Site-Scripting-Command-Injection.html (advisory)
- https://packetstormsecurity.com/files/171626/AD-Manager-Plus-7122-Remote-Code-Execution.html (advisory)
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0032 (advisory)
- https://seclists.org/fulldisclosure/2022/Jul/11 (advisory)
- https://seclists.org/fulldisclosure/2022/Mar/23 (advisory)
- https://security.netapp.com/advisory/ntap-20211210-0007 (advisory)
- https://support.apple.com/kb/HT213189 (advisory)
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd (advisory)
- https://www.bentley.com/en/common-vulnerability-exposure/be-2022-0001 (advisory)
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-44228 (advisory)
- https://www.debian.org/security/2021/dsa-5020 (advisory)
- https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00646.html (advisory)
- https://www.kb.cert.org/vuls/id/930724 (advisory)
- https://www.oracle.com/security-alerts/alert-cve-2021-44228.html (advisory)
- https://cert-portal.siemens.com/productcert/pdf/ssa-479842.pdf (advisory)
- https://cert-portal.siemens.com/productcert/pdf/ssa-661247.pdf (advisory)
- https://cert-portal.siemens.com/productcert/pdf/ssa-714170.pdf (advisory)
- https://github.com/advisories/GHSA-7rjr-3q55-vv33 (advisory)
- https://github.com/cisagov/log4j-affected-db (advisory)
- https://lists.debian.org/debian-lts-announce/2021/12/msg00007.html (advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M5CSVUNV4HWZZXGOKNSK6L7RPM7BOKIB (advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VU57UJDCFIASIO35GC55JMKSRXJMCDFM (advisory)
- https://logging.apache.org/log4j/2.x/security.html (advisory)
- http://packetstormsecurity.com/files/165225/Apache-Log4j2-2.14.1-Remote-Code-Execution.html (advisory)
- http://packetstormsecurity.com/files/165260/VMware-Security-Advisory-2021-0028.html (advisory)
- http://packetstormsecurity.com/files/165281/Log4j2-Log4Shell-Regexes.html (advisory)
- http://packetstormsecurity.com/files/165282/Log4j-Payload-Generator.html (advisory)
- http://packetstormsecurity.com/files/165306/L4sh-Log4j-Remote-Code-Execution.html (advisory)
- http://packetstormsecurity.com/files/165307/Log4j-Remote-Code-Execution-Word-Bypassing.html (advisory)
- http://packetstormsecurity.com/files/165311/log4j-scan-Extensive-Scanner.html (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/10/1 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/10/2 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/10/3 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/13/1 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/13/2 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/14/4 (advisory)
- http://www.openwall.com/lists/oss-security/2021/12/15/3 (advisory)
- https://github.com/advisories/GHSA-jfh8-c2jp-5v3q (advisory)
- https://packetstormsecurity.com/files/165673/UniFi-Network-Application-Unauthenticated-Log4Shell-Remote-Code-Execution.html (evidence)
- https://packetstormsecurity.com/files/167917/MobileIron-Log4Shell-Remote-Command-Execution.html (evidence)
- https://seclists.org/fulldisclosure/2022/Dec/2 (evidence)
- https://twitter.com/kurtseifried/status/1469345530182455296 (evidence)
- https://www.nu11secur1ty.com/2021/12/cve-2021-44228.html (evidence)
- https://github.com/nu11secur1ty/CVE-mitre/tree/main/CVE-2021-44228 (evidence)
- https://github.com/tangxiaofeng7/apache-log4j-poc (evidence)
- http://packetstormsecurity.com/files/165261/Apache-Log4j2-2.14.1-Information-Disclosure.html (evidence)
- http://packetstormsecurity.com/files/165270/Apache-Log4j2-2.14.1-Remote-Code-Execution.html (evidence)
- http://packetstormsecurity.com/files/165371/VMware-Security-Advisory-2021-0028.4.html (evidence)
- http://packetstormsecurity.com/files/165532/Log4Shell-HTTP-Header-Injection.html (evidence)
- http://packetstormsecurity.com/files/165642/VMware-vCenter-Server-Unauthenticated-Log4Shell-JNDI-Injection-Remote-Code-Execution.html (evidence)
- https://github.com/apache/logging-log4j2 (package)
- https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd
- https://github.com/cisagov/log4j-affected-db/blob/develop/SOFTWARE-LIST.md

---

Source: CVEminer (https://cveminer.com/vulnerabilities/CVE-2021-44228), compiled from OSV (GitHub advisory), GitHub Advisory Database, OSV (CVE record), CVE.org, CISA KEV catalog. OSV and GitHub Advisory Database content is licensed CC BY 4.0.
