CVE-2021-45105: Apache Log4j2 uncontrolled recursion in self-referential lookups

CVE-2021-45105 · Severity: high · CVSS 8.6 · Published 2021-12-18

Apache Log4j2, a widely used logging library for Java applications, is vulnerable to a flaw that can cause systems to crash or become unresponsive. By sending specifically crafted data to an application that logs that information, an attacker can trigger an infinite loop that exhausts system resources. This results in a denial-of-service, potentially disrupting business operations and service availability.

Technologies: org.apache.logging.log4j:log4j-core (Maven), org.ops4j.pax.logging:pax-logging-log4j2 (Maven). Vendors: Maven.

Quick answers

Is CVE-2021-45105 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-45105 being exploited in the wild.
How severe is CVE-2021-45105?
High severity, with a CVSS score of 8.6, published 18 December 2021.
Which products and versions are affected?
org.apache.logging.log4j:log4j-core (Maven) ECOSYSTEM:introduced=2.4.0,fixed=2.12.3; org.ops4j.pax.logging:pax-logging-log4j2 (Maven) ECOSYSTEM:introduced=1.8.0,fixed=1.9.2; OPS4J Pax-Logging-Log4j2 >= 1.8.0, < 1.9.2; >= 1.10.0, < 1.10.9; >= 1.11.0, < 1.11.12; >= 2.0.0, < 2.0.13.
Is there a fix for CVE-2021-45105?
Yes. org.apache.logging.log4j:log4j-core (Maven): upgrade to 2.12.3 or later; org.ops4j.pax.logging:pax-logging-log4j2 (Maven): upgrade to 1.9.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-45105 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2021-45105?
Check whether you run org.apache.logging.log4j:log4j-core (Maven), org.ops4j.pax.logging:pax-logging-log4j2 (Maven) or OPS4J Pax-Logging-Log4j2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • org.apache.logging.log4j:log4j-core (Maven): upgrade to 2.12.3 or later
    # set org.apache.logging.log4j:log4j-core to 2.12.3 in your pom.xml or build.gradle
  • org.ops4j.pax.logging:pax-logging-log4j2 (Maven): upgrade to 1.9.2 or later
    # set org.ops4j.pax.logging:pax-logging-log4j2 to 1.9.2 in your pom.xml or build.gradle

Technical details

Apache Log4j2 (specifically the log4j-core component) fails to properly validate input during recursive evaluation of self-referential lookups. An attacker who can provide or influence Thread Context Map data can inject a crafted string that triggers uncontrolled recursion. This leads to a StackOverflowError, terminating the process and resulting in a denial-of-service. The vulnerability is reachable over the network without authentication if the application logs attacker-controlled input using a vulnerable layout pattern. This issue is fixed in versions 2.17.0, 2.12.3, and 2.3.1.

Affected products

  • Apache Log4j2 >= 2.0-alpha1, <= 2.16.0 (excluding 2.12.3)
  • OPS4J pax-logging-log4j2 >= 1.8.0, < 1.9.2; >= 1.10.0, < 1.10.9; >= 1.11.0, < 1.11.12; >= 2.0.0, < 2.0.13

Identifiers

  • CVE-2021-45105
  • GHSA-p6xc-xr62-6r2g

Timeline

  • 2021-12-18: disclosed
  • 2021-12-18: advisory
  • 2021-12-18: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.