CVE-2021-45046: Apache Log4j Thread Context Lookup Injection and Code Execution
- Vendors
- SiemensIntel CorporationCvatDebian ProjectSonicwallFedora ProjectApache Software Foundation
CVE-2021-45046 is a lookup injection vulnerability in Apache Log4j 2 arising from the incomplete fix for CVE-2021-44228 in version 2.15.0. Certain non-default PatternLayout configurations evaluate attacker-controlled Thread Context Map (MDC) data containing malicious JNDI lookup expressions. Exploitable configurations include layouts containing a Context Lookup or Thread Context Map patterns such as %X, %mdc, or %MDC. Successful exploitation can cause information disclosure, local code execution, and remote code execution in some environments.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Exploitation can compromise the confidentiality, integrity, and availability of the affected Java application. Malicious JNDI lookups can disclose information and execute arbitrary code with the application's privileges; remote code execution depends on the runtime environment. Denial of service is also possible in affected configurations. Successful code execution can enable broader compromise within the application's permissions and network reach.
Mitigation
If you can’t patch tonight, do this now.
If upgrading is not immediately possible, remove the JndiLookup class from affected log4j-core archives and the runtime classpath, following vendor instructions, and restart affected applications. Setting log4j2.formatMsgNoLookups=true alone does not mitigate this vulnerability. Restrict network exposure and outbound connections from affected systems, segment vulnerable services, and run applications with least privilege as defense-in-depth measures. WAF rules and monitoring for suspicious JNDI activity or Java processes spawning shells can supplement, but not replace, remediation.
Remediation
Patch, then assume compromise.
Upgrade affected applications and embedded log4j-core dependencies to a current, supported, vendor-approved fixed release. The releases addressing this vulnerability are Log4j 2.16.0 for Java 8+, 2.12.2 for Java 7, and 2.3.1 for Java 6. These fixes remove message lookup support and disable JNDI functionality by default. These historical releases do not address every subsequently disclosed Log4j vulnerability. Update bundled, shaded, and indirect dependencies, redeploy affected applications, and keep log4j-api aligned with log4j-core where both are used. For packaged commercial products, follow the vendor's supported patching procedure.
Exploits
4 exploits validated by Mallory's analysis. Hidden: 19 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2021-45046 exploited in the wild?
- Yes. As of Nov 4, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on May 1, 2023.
- Is there a public exploit for CVE-2021-45046?
- Yes. Mallory tracks 4 public exploits or proofs of concept for CVE-2021-45046, the earliest disclosed Dec 15, 2021.
- Is there a patch for CVE-2021-45046?
- Upgrade affected applications and embedded log4j-core dependencies to a current, supported, vendor-approved fixed release. The releases addressing this vulnerability are Log4j 2.16.0 for Java 8+, 2.12.2 for Java 7, and 2.3.1 for Java 6.
- What products are affected by CVE-2021-45046?
- Apache Software Foundation Log4j, Siemens 6bk1602-0aa12-0tp0 Firmware, Siemens 6bk1602-0aa22-0tp0 Firmware, Siemens 6bk1602-0aa32-0tp0 Firmware, Siemens 6bk1602-0aa42-0tp0 Firmware, and at least 50 more.
- How severe is CVE-2021-45046?
- CVE-2021-45046 has a CVSS v3.1 score of 9.0 (Critical) and an EPSS score of 100.0% (100th percentile) as of Nov 4, 2026.
Recent activity
141 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.