CVE-2021-45105

Apache Log4j2 does not always protect from infinite recursion in lookup evaluation

Description

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.

Remediation

Workaround:

  • Implement one of the following mitigation techniques: * Java 8 (or later) users should upgrade to release 2.17.0. Alternatively, this can be mitigated in configuration: * In PatternLayout in the logging configuration, replace Context Lookups like `${ctx:loginId}` or `$${ctx:loginId}` with Thread Context Map patterns (%X, %mdc, or %MDC). * Otherwise, in the 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.

Category

5.9
CVSS
Severity: Medium
CVSS 3.1 •
CVSS 2.0 •
EPSS 72.18% Top 5%
Vendor Advisory cisco.com Vendor Advisory debian.org Vendor Advisory apache.org
Affected: Apache Software Foundation Apache Log4j2
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2021-45105?
CVE-2021-45105 has been scored as a medium severity vulnerability.
How to fix CVE-2021-45105?
As a workaround for remediating CVE-2021-45105: Implement one of the following mitigation techniques: * Java 8 (or later) users should upgrade to release 2.17.0. Alternatively, this can be mitigated in configuration: * In PatternLayout in the logging configuration, replace Context Lookups like `${ctx:loginId}` or `$${ctx:loginId}` with Thread Context Map patterns (%X, %mdc, or %MDC). * Otherwise, in the 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.
Is CVE-2021-45105 being actively exploited in the wild?
It is possible that CVE-2021-45105 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~72% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2021-45105?
CVE-2021-45105 affects Apache Software Foundation Apache Log4j2.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.