CVE-2021-45046

9.0 CRITICAL

📋 TL;DR

CVE-2021-45046 is an incomplete fix for the Log4Shell vulnerability (CVE-2021-44228) in Apache Log4j 2.15.0 that allows attackers to execute arbitrary code via JNDI lookups in certain non-default logging configurations. This affects systems using Log4j 2.0-beta9 through 2.15.0 with specific Pattern Layout configurations. The vulnerability enables remote code execution in some environments and local code execution in all vulnerable configurations.

💻 Affected Systems

Products:
  • Apache Log4j
Versions: 2.0-beta9 through 2.15.0
Operating Systems: All operating systems running Java
Default Config Vulnerable: ✅ No
Notes: Only vulnerable in non-default configurations using Pattern Layout with Context Lookup or Thread Context Map patterns.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution leading to complete system compromise, data exfiltration, and lateral movement within the network.

🟠

Likely Case

Remote code execution leading to malware deployment, data theft, and system compromise in vulnerable configurations.

🟢

If Mitigated

Limited impact with proper network segmentation, egress filtering, and security controls in place.

🌐 Internet-Facing: HIGH - Internet-facing systems are directly exposed to exploitation attempts.
🏢 Internal Only: HIGH - Internal systems remain vulnerable to lateral movement and insider threats.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Widely exploited in the wild with numerous public proof-of-concept exploits available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.16.0 (Java 8) or 2.12.2 (Java 7)

Vendor Advisory: https://logging.apache.org/log4j/2.x/security.html

Restart Required: Yes

Instructions:

1. Identify all applications using Log4j 2.0-beta9 through 2.15.0. 2. Upgrade to Log4j 2.16.0 (Java 8) or 2.12.2 (Java 7). 3. Restart all affected applications. 4. Verify the fix by checking the Log4j version.

🔧 Temporary Workarounds

Remove JNDI Lookup Class

linux

Remove the JndiLookup class from the classpath to disable JNDI functionality.

find / -name "log4j-core-*.jar" -type f 2>/dev/null | xargs -I {} zip -q -d {} org/apache/logging/log4j/core/lookup/JndiLookup.class

Set System Property

all

Disable JNDI lookups by setting the log4j2.formatMsgNoLookups system property.

java -Dlog4j2.formatMsgNoLookups=true -jar your-application.jar

🧯 If You Can't Patch

  • Implement network segmentation to isolate vulnerable systems
  • Deploy web application firewalls with Log4j attack signatures

🔍 How to Verify

Check if Vulnerable:

Check for Log4j JAR files version 2.0-beta9 through 2.15.0: find / -name "*log4j-core*.jar" -type f 2>/dev/null | xargs -I {} sh -c 'echo {}; unzip -p {} META-INF/MANIFEST.MF | grep "Implementation-Version"'

Check Version:

java -cp log4j-core-*.jar org.apache.logging.log4j.core.Version

Verify Fix Applied:

Verify Log4j version is 2.16.0 or higher (Java 8) or 2.12.2 (Java 7) using the same command as above.

📡 Detection & Monitoring

Log Indicators:

  • JNDI lookup patterns like ${jndi:ldap://, ${jndi:rmi://, ${ctx:, ${sys:, ${env:

Network Indicators:

  • Outbound LDAP/RMI connections from applications to unknown external servers

SIEM Query:

source="*log*" AND "${jndi:"

🔗 References

📤 Share & Export