cve.bz

CVE-2021-45105 Uncontrolled Recursion

5.9 mediumEPSS >99.9%Fix available

Medium (5.9). EPSS >99.9% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.logging.log4j:log4j-core 2.12.3, 2.17.0, 2.3.1.

On this page
Apache Log4j2 versions 2.0-alpha1 through 2.16.0 (excluding 2.12.3 and 2.3.1) did not protect from uncontrolled recursion from self-referential lookups. This allows an attacker with control over Thread Context Map data to cause a denial of service when a crafted string is interpreted. This issue was fixed in Log4j 2.17.0, 2.12.3, and 2.3.1.

Severity

CVSS 3.1

5.9 medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/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's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-05-29. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-20 Improper Input Validation
CWE-674 Uncontrolled Recursion
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-45105 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-45105?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-45105?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-45105 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 Log4j2from log4j-core before 2.17.0

Fixed in

ProductFixed in
Apache Software Foundation Apache Log4j22.12.3
Apache Software Foundation Apache Log4j22.3.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-p6xc-xr62-6r2gMavenorg.apache.logging.log4j:log4j-core>=2.4.0 <2.12.32.12.3
GHSA-p6xc-xr62-6r2gMavenorg.apache.logging.log4j:log4j-core>=2.13.0 <2.17.02.17.0
GHSA-p6xc-xr62-6r2gMavenorg.apache.logging.log4j:log4j-core<2.3.12.3.1
GHSA-p6xc-xr62-6r2gMavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.8.0 <1.9.21.9.2
GHSA-p6xc-xr62-6r2gMavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.10.0 <1.10.91.10.9
GHSA-p6xc-xr62-6r2gMavenorg.ops4j.pax.logging:pax-logging-log4j2>=1.11.0 <1.11.121.11.12
GHSA-p6xc-xr62-6r2gMavenorg.ops4j.pax.logging:pax-logging-log4j2>=2.0.0 <2.0.132.0.13

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9apache-log4j22.12.3-0+deb9u1DLA-2852-1
Debian10apache-log4j22.17.0-1~deb10u1DSA-5024-1
Debian11apache-log4j22.17.0-1~deb11u1DSA-5024-1
Debian12, 13, 14apache-log4j22.17.0-1DEBIAN-CVE-2021-45105
Ubuntu18.04:LTSapache-log4j22.12.4-0ubuntu0.1UBUNTU-CVE-2021-45105 USN-5222-1
Ubuntu20.04:LTSapache-log4j22.17.0-0.20.04.1UBUNTU-CVE-2021-45105 USN-5203-1 USN-5222-1
UbuntuPro:16.04:LTSapache-log4j2no fix listedUBUNTU-CVE-2021-45105
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 Hatred_hat_single_sign_on:7.5::el7rh-sso7-keycloak, rh-sso7-keycloak-server0:15.0.6-1.redhat_00001.1.el7ssoRHSA-2022:1462
Red Hatred_hat_single_sign_on:7.5::el8rh-sso7-keycloak, rh-sso7-keycloak-server0:15.0.6-1.redhat_00001.1.el8ssoRHSA-2022:1463
openSUSELeap 15.2log4j2.17.0-lp152.3.12.1openSUSE-SU-2021:1605-1
openSUSELeap 15.3log4j2.17.0-4.13.1openSUSE-SU-2021:4118-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

Red Hat Product Security has performed an analysis of this flaw and has classified the Attack Complexity(AC) as High because there are multiple factors involved which are beyond attacker's control:

- The application has to use the logging configuration using a Context Map Lookup (for example, $${ctx:loginId}) which is a non-default Pattern Layout.

- The application developer has to use the map org.apache.logging.log4j.ThreadContext in the application code and save at-least one key (for example, ThreadContext.put("loginId", "myId");) in the ThreadContext map object.

- Attackers must also know this saved key name in order to exploit this flaw.

Note that saving keys in this map is a non-essential usage of log4j and just an optional feature provided. Refer to https://logging.apache.org/log4j/2.x/manual/lookups.html#ContextMapLookup to know more about the Context Map Lookup feature of Log4j.

Log4j 1.x is not impacted by this vulnerability. Note that only the log4j-core JAR file is impacted by this vulnerability. Applications using ONLY the log4j-api JAR file without the log4j-core JAR file are NOT impacted by this vulnerability.

Despite including a vulnerable version of Log4j 2.x, this vulnerability is not exploitable in Elasticsearch[0], as shipped in OpenShift Container Platform and OpenShift Logging. OpenShift 3.11 specifically does not contain any context lookups:

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

This vulnerability is therefore rated Low for Elasticsearch in OpenShift Container Platform and OpenShift Logging.

[0] https://discuss.elastic.co/t/apache-log4j2-remote-code-execution-rce-vulnerability-cve-2021-44228-esa-2021-31/291476#update-december-18-4

Red Hat's mitigation

For Log4j 2 versions up to and including 2.16.0, this flaw can be mitigated by:

- In PatternLayout in the Log4j logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC) like %X{loginId}.

- Otherwise, in the Log4j logging configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input.

ProductPackageStateAdvisory
OpenShift Logging 5.0openshift-logging/elasticsearch6-rhel8:v5.0.11-2Fixed 2022-01-10RHSA-2022:0047
OpenShift Logging 5.1openshift-logging/elasticsearch6-rhel8:v6.8.1-82Fixed 2022-01-10RHSA-2022:0042
OpenShift Logging 5.2openshift-logging/elasticsearch6-rhel8:v6.8.1-83Fixed 2022-01-10RHSA-2022:0043
OpenShift Logging 5.3openshift-logging/elasticsearch6-rhel8:v6.8.1-84Fixed 2022-01-10RHSA-2022:0044
Red Hat AMQ Streams 1.6.6Fixed 2022-01-20RHSA-2022:0219
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-00001Fixed 2022-01-20RHSA-2022:0216
A-MQ Clients 2log4j-coreNot affected
Red Hat AMQ Broker 7log4j-coreNot affected
Red Hat build of Quarkuslog4j-coreNot affected
Red Hat Decision Manager 7log4j-apiAffected
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
18 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-45105.

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.

Attack patterns (CAPEC)

  • CAPEC-230 Serialized Data with Nested Payloads Likelihood: Medium · Severity: High
  • CAPEC-231 Oversized Serialized Data Payloads Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-20 (51).

References

Check your stackJSON