Skip to main content
← All vulnerabilities
CVE-2021-45046GHSA-7RJR-3Q55-VV33

Apache Log4j2 Thread Context Message Pattern and Context Lookup Pattern vulnerable to a denial of service attack

Affects Apache Log4j2 when the logging configuration uses a non-default Pattern Layout with a Context Lookup or Thread Context Map pattern (%X, %mdc, %MDC). Fixed in log4j-core 2.16.0.

Published
Last modified
published
Listed in CISA KEV
Actively exploited
Fix
Fixed in 2.16.0, 2.12.2, 1.9.2, 1.10.8, 1.11.11, and 2 more
None on Exploit-DB, Metasploit or GitHub

Summary

Apache Log4j2, a Java logging library, is affected when it uses a non-default pattern layout that includes Thread Context Map or Context Lookup patterns. An attacker who can control logged input could leak sensitive information, and could run code remotely in some environments or locally in all environments.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

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.

Timeline

  1. CVE published
  2. Added to CISA KEV

    CISA has evidence of exploitation in the wild

  3. CISA remediation deadline

    Due date for US federal agencies to patch

  4. Record last updated
  5. EPSS reached 10%

    FIRST estimates at least a 10% chance of exploitation in the next 30 days

Affected versions

  • Apache Software Foundation Apache Log4j

    From Apache Log4j2 · fixed in 2.16.0

  • org.apache.logging.log4j:log4j-coreMaven

    From 2.13.0 · fixed in 2.16.0

  • org.apache.logging.log4j:log4j-coreMaven

    From 2.4.0 · fixed in 2.12.2

  • org.ops4j.pax.logging:pax-logging-log4j2Maven

    From 1.8.0 · fixed in 1.9.2

  • org.ops4j.pax.logging:pax-logging-log4j2Maven

    From 1.10.0 · fixed in 1.10.8

  • org.ops4j.pax.logging:pax-logging-log4j2Maven

    From 1.11.0 · fixed in 1.11.11

  • org.ops4j.pax.logging:pax-logging-log4j2Maven

    From 2.0.0 · fixed in 2.0.12

  • org.apache.logging.log4j:log4j-coreMaven

    fixed in 2.3.1

References 21

psirt.global.sonicwall.com

oracle.com

cve.org

openwall.com

logging.apache.org

kb.cert.org

cert-portal.siemens.com

intel.com

tools.cisco.com

debian.org

lists.fedoraproject.org

security.gentoo.org

FAQ

Questions about CVE-2021-45046

What does this mean?

Crafted malicious input data that uses a JNDI Lookup pattern can cause a denial of service (DoS) attack against the logging component.Source: lists.debian.org

Am I affected, and how do I check?

Affected log4j-core ranges include versions from 0 up to 2.3.1, 2.4.0 up to 2.12.2, and 2.13.0 up to 2.16.0, plus several pax-logging-log4j2 ranges (1.8.0 to 1.9.2, 1.10.0 to 1.10.8, 1.11.0 to 1.11.11, and 2.0.0 to 2.0.12). The issue applies only when the logging configuration uses a non-default Pattern Layout with a Context Lookup or a Thread Context Map pattern (%X, %mdc, or %MDC), so check the log4j-core version in the project's dependencies and the pattern layout in the logging configuration.Source: lists.debian.org

What should I do about it?

Upgrade log4j-core to 2.16.0 or later. For pax-logging-log4j2, upgrade to the fixed version for the affected branch (1.9.2, 1.10.8, 1.11.11, or 2.0.12). Debian packages carry the fix as 2.16.0-1~deb11u1.Source: lists.debian.org

Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2023-05-01, which means it has evidence of attacks. No public exploit code is tracked.Source: cisa.gov, cve.now feed data