cve.bz

CVE-2021-45046 Apache Log4j2 Deserialization of Untrusted Data Vulnerability

9.0 criticalKEVExploitEPSS >99.9%Fix available

Critical (9.0) in Apache Log4j2. In CISA KEV since 2023-05-01, with known ransomware use. EPSS >99.9% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.logging.log4j:log4j-core 2.12.2, 2.16.0, 2.3.1.

On this page
It was found that the fix to address CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete in certain non-default configurations. This could allows attackers with control over Thread Context Map (MDC) input data when the logging configuration uses a non-default Pattern Layout with either a Context Lookup (for example, $${ctx:loginId}) or a Thread Context Map pattern (%X, %mdc, or %MDC) to craft malicious input data using a JNDI Lookup pattern resulting in an information leak and remote code execution in some environments and local code execution in all environments. Log4j 2.16.0 (Java 8) and 2.12.2 (Java 7) fix this issue by removing support for message lookup patterns and disabling JNDI functionality by default.

Severity

CVSS 3.1

9.0 critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS
>99.9% (unchanged from >99.9% a week ago; >99.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 100th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA KEV
listed 2023-05-01, due 2023-05-22, known ransomware use
CISA's assessment (SSVC)
Exploitation: active · Automatable: no · Technical impact: total, assessed 2025-02-04. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-45046 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-45046?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-45046?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-45046 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Apache Software Foundation Apache Log4jfrom Apache Log4j2 before 2.16.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7rjr-3q55-vv33Mavenorg.apache.logging.log4j:log4j-core>=2.13.0 <2.16.02.16.0
GHSA-7rjr-3q55-vv33Mavenorg.apache.logging.log4j:log4j-core>=2.4.0 <2.12.22.12.2
GHSA-7rjr-3q55-vv33Mavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.8.0 <1.9.21.9.2
GHSA-7rjr-3q55-vv33Mavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.10.0 <1.10.81.10.8
GHSA-7rjr-3q55-vv33Mavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.11.0 <1.11.111.11.11
GHSA-7rjr-3q55-vv33Mavenorg.ops4j.pax.logging:pax-logging-log4j2>=2.0.0 <2.0.122.0.12
GHSA-7rjr-3q55-vv33Mavenorg.apache.logging.log4j:log4j-core<2.3.12.3.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10apache-log4j22.16.0-1~deb10u1DSA-5022-1
Debian11apache-log4j22.16.0-1~deb11u1DSA-5022-1
Debian12, 13, 14apache-log4j22.16.0-1DEBIAN-CVE-2021-45046
Ubuntu20.04:LTSapache-log4j22.16.0-0.20.04.1UBUNTU-CVE-2021-45046 USN-5197-1
Red Hatjboss_enterprise_application_platform:7.4::el7eap7-log4j0:2.17.1-1.redhat_00001.1.el7eapRHSA-2022:1296
Red Hatjboss_enterprise_application_platform:7.4::el8eap7-log4j0:2.17.1-1.redhat_00001.1.el8eapRHSA-2022:1297
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-apache-cxf, eap7-apache-cxf-rt, eap7-apache-cxf-tools and 1 more0:3.1.16-4.redhat_00003.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-jackson-databind0:2.8.11.6-2.SP1_redhat_00002.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-jettison0:1.3.8-2.redhat_00002.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-netty, eap7-netty-all0:4.1.63-1.Final_redhat_00002.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-resteasy, eap7-resteasy-cdi, eap7-resteasy-jaxrs and 14 more0:3.0.27-1.Final_redhat_00001.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-snakeyaml0:1.33.0-1.SP1_redhat_00001.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-velocity0:1.7.0-3.redhat_00006.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.1::el7eap7-wildfly, eap7-wildfly-modules0:7.1.9-2.GA_redhat_00002.1.ep7.el7RHSA-2025:1746
Red Hatjboss_enterprise_application_platform_eus:7.3::el7eap7-hal-console0:3.2.17-1.Final_redhat_00001.1.el7eapRHSA-2025:1747
Red Hatjboss_enterprise_application_platform_eus:7.3::el7eap7-jackson-core, eap7-jackson-jaxrs-base, eap7-jackson-annotations and 5 more0:2.10.4-2.redhat_00004.1.el7eapRHSA-2025:1747
6 more for Red Hat in the JSON and on Red Hat's page.
openSUSELeap 15.2disruptor3.4.4-lp152.2.3.1openSUSE-SU-2021:1601-1
openSUSELeap 15.2jakarta-servlet5.0.0-lp152.2.1openSUSE-SU-2021:1601-1
openSUSELeap 15.2log4j2.16.0-lp152.3.9.1openSUSE-SU-2021:1601-1
openSUSELeap 15.3disruptor3.4.4-3.3.1openSUSE-SU-2021:4107-1
openSUSELeap 15.3jakarta-servlet5.0.0-5.3.1openSUSE-SU-2021:4107-1
openSUSELeap 15.3log4j2.13.0-4.6.1openSUSE-SU-2021:4094-1
openSUSELeap 15.3log4j2.16.0-4.10.1openSUSE-SU-2021:4107-1
openSUSETumbleweedlog4j2.16.0-2.1openSUSE-SU-2024:11681-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Although we have matched Apache's CVSS score, with the exception of the scope metric which will remain unaltered at "unchanged"; as we believe code execution would be at the permission levels of the running JVM and not exceeding that of the original CVE-2021-44228 flaw.

We have given this vulnerability an impact rating of Moderate, this is because of the unlikely nature of log4j lookup mapping values being derived from attacker controlled values. This is not the default configuration for end-applications using log4j 2.x and would require explicit action from a privileged user (a developer or administrator) to access the vulnerability.

In certain non-default configurations, it was found that the fix to address CVE-2021-44228 in Apache Log4j 2.15.0 was insufficient.

This issue affects the log4j version between 2.0 and 2.15. Log4j 1.x is NOT impacted by this vulnerability.

Prerequisites to exploit this flaw are :

- A remotely accessible endpoint with any protocol (HTTP, TCP, etc) that allows an attacker to send arbitrary data,

- A log statement in the endpoint that logs the attacker controlled data.

- Log4j configuration file should be explicitly configured to use a non-default Pattern Layout with a Context Lookup eg. ($${ctx:loginId})

In most cases, the mitigation suggested for CVE-2021-44228 (i.e. to set the system property `log4j2.noFormatMsgLookup` to `true) does NOT mitigate this specific vulnerability.

Log4j 2.16.0 fixes this issue by removing support for message lookup patterns and disabling JNDI functionality by default.

For Elasticsearch, as shipped in OpenShift 3.11, the "log4j2.formatMsgNoLookups=true" system property mitigation is sufficient as there are no included non-standard configurations that allow for exploitation:

https://github.com/openshift/openshift-ansible/blob/release-3.11/roles/openshift_logging_elasticsearch/templates/log4j2.properties.j2

https://discuss.elastic.co/t/apache-log4j2-remote-code-execution-rce-vulnerability-cve-2021-44228-esa-2021-31/291476

For CodeReady Studio the fix for this flaw is available on CodeReady Studio 12.21.3 and above versions.

Red Hat's mitigation

For Log4j versions up to and including 2.15.0, this issue can be mitigated by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class).

ProductPackageStateAdvisory
OpenShift Logging 5.0openshift-logging/elasticsearch6-rhel8:v5.0.10-1Fixed 2021-12-14RHSA-2021:5137
OpenShift Logging 5.1openshift-logging/elasticsearch6-rhel8:v6.8.1-67Fixed 2021-12-14RHSA-2021:5128
OpenShift Logging 5.2openshift-logging/elasticsearch6-rhel8:v6.8.1-66Fixed 2021-12-14RHSA-2021:5127
OpenShift Logging 5.3openshift-logging/elasticsearch6-rhel8:v6.8.1-65Fixed 2021-12-14RHSA-2021:5129
Red Hat AMQ Streams 2.0.0Fixed 2022-01-13RHSA-2022:0138
Red Hat Data Grid 8.2.3log4j-coreFixed 2022-01-20RHSA-2022:0205
Red Hat Fuse 7.8.2, 7.9.1, 7.10.1log4j-coreFixed 2022-01-20RHSA-2022:0203
Red Hat Integration Camel Extensions for Quarkus 2.2Fixed 2022-01-20RHSA-2022:0222
Red Hat Integration Camel-K 1.6.3log4j-coreFixed 2022-01-20RHSA-2022:0223
Red Hat JBoss Enterprise Application Platformorg.apache.logging.log4j/log4j-api:2.17.1.redhat-00002Fixed 2021-12-15RHSA-2021:5140
A-MQ Clients 2log4j-coreNot affected
Red Hat AMQ Broker 7log4jNot affected
Red Hat build of Quarkuslog4j-coreNot affected
Red Hat Decision Manager 7log4j-coreNot affected
Red Hat Enterprise Linux 6log4jNot affected
Red Hat Enterprise Linux 7log4jNot affected
Red Hat Enterprise Linux 8parfait:0.5/log4j12Not affected
Red Hat Integration Camel Quarkus 1log4j-coreAffected
Red Hat JBoss Enterprise Application Platform 6log4jNot affected
Red Hat JBoss Enterprise Application Platform Expansion Packlog4j-coreNot affected
42 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-45046.

Public exploits

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

References

Check your stackJSON