Vulnerability record · CVE-2021-45046 · published 14 December 2021
CVE-2021-45046: Apache Log4j 2.15.0 Incomplete Fix Allows JNDI Lookup Injection
Apache · Log4j
The fix for CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete in certain non-default configurations. When a non-default Pattern Layout uses a Context Lookup (e.g., $${ctx:loginId}) or Thread Context Map pattern (%X, %mdc, %MDC), an attacker who controls that input can inject a JNDI Lookup pattern, causing an information leak and remote code execution in some environments and local code execution in all environments.
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.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
Automated analysis
critical priorityCVSS 9.0 critical, CISA KEV listed with known ransomware use, and EPSS above 99.9th percentile make this an urgent patch-first issue despite the non-default configuration precondition.
What it is
The fix for CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete in certain non-default configurations. When a non-default Pattern Layout uses a Context Lookup (e.g., $${ctx:loginId}) or Thread Context Map pattern (%X, %mdc, %MDC), an attacker who controls that input can inject a JNDI Lookup pattern, causing an information leak and remote code execution in some environments and local code execution in all environments.
Impact
An attacker can leak sensitive information and, in some environments, achieve remote code execution; local code execution is possible in all environments. This can lead to full compromise of the affected application and its host.
Attack surface
Reachable over the network (AV:N) with no authentication (PR:N) and no user interaction (UI:N), but exploitation requires a non-default logging configuration and attacker control over Thread Context Map input data. The high attack complexity (AC:H) reflects those configuration and input-control preconditions.
Exploitation
CVE-2021-45046 is listed in CISA KEV with known ransomware campaign use, and EPSS shows a 30-day probability of 0.99977 (99.98th percentile). Reference tags include Mitigation, Patch, Vendor Advisory and Third Party Advisory, indicating public mitigation and patch guidance is available.
What to do
- Upgrade to Log4j 2.16.0 (Java 8) or 2.12.2 (Java 7), which remove message lookup patterns and disable JNDI by default.
- If immediate upgrade is not possible, remove JndiLookup from the classpath and disable message lookups per vendor mitigation guidance.
- Audit logging configurations for non-default Pattern Layouts using $${ctx:...}, %X, %mdc or %MDC and remove or restrict them.
- Apply vendor patches for downstream products listed as affected (Apache, Intel, Siemens, Debian, SonicWall, Fedora, CVAT).
- Treat any Thread Context Map input as untrusted and sanitize or reject JNDI-style lookup strings.
Detection
- Search application and WAF logs for JNDI lookup strings such as ${jndi:ldap://, ${jndi:rmi://, ${jndi:dns:// and obfuscated variants in MDC/Thread Context input.
- Monitor for outbound LDAP, RMI or DNS connections from Java application servers to unexpected external hosts.
- Alert on logging configuration changes that introduce $${ctx:...}, %X, %mdc or %MDC patterns.
- Inventory Log4j versions across the estate and flag any 2.15.0 or earlier deployments.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Exploitation in the wild
CISA added CVE-2021-45046 to the Known Exploited Vulnerabilities catalog on 1 May 2023 as "Apache Log4j2 Deserialization of Untrusted Data Vulnerability". CISA reports known use in ransomware campaigns. Required action: Apply updates per vendor instructions. Federal deadline 22 May 2023.
Affected products
55 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2021-45046 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-45046), CISA KEV, FIRST EPSS (scores of 2026-09-16). This page is refreshed as NVD updates the record.