Log4j Vulnerability (CVE-2021-44228)

By
Anandhu Krishnan
Published on
14 May 2024
Vulnerability

Description

Apache Log4j2 versions up to 2.14.1 are vulnerable to JNDI injection attacks, which can execute arbitrary code via LDAP and other JNDI endpoints if log messages or parameters are attacker-controlled and message lookup substitution is enabled. This vulnerability has been mitigated in Log4j 2.15.0, where the JNDI features are disabled by default.

Recommendation

Upgrade Log4j2 to version 2.17.1 or newer to address JNDI injection vulnerabilities. For versions earlier than 2.17.1, mitigate the risk by setting the system property “log4j2.formatMsgNoLookups” to “true” or removing the JndiLookup class from the classpath. Additionally, Java 8u121 and later protect against remote code execution by defaulting “com.sun.jndi.rmi.object.trustURLCodebase” and “com.sun.jndi.cosnaming.object.trustURLCodebase” to “false”.


Written by
Anandhu Krishnan
Anandhu Krishnan
Lead Engineer
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days