Details
Alert Id 40043-1
Alert Type Active
Status alpha
Risk High
CWE 117
WASC 20
Tags OUT_OF_BAND
OWASP_2017_A09
OWASP_2021_A06
WSTG-V42-INPV-11

Summary

Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default.

Solution

Upgrade Log4j2 to version 2.17.1 or newer. In previous releases (>2.10) this behavior can be mitigated by setting system property 'log4j2.formatMsgNoLookups' to 'true' or by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class). Java 8u121 (see https://www.oracle.com/java/technologies/javase/8u121-relnotes.html) protects against remote code execution by defaulting 'com.sun.jndi.rmi.object.trustURLCodebase' and 'com.sun.jndi.cosnaming.object.trustURLCodebase' to 'false'.

References

Code

org/zaproxy/zap/extension/ascanrulesAlpha/Log4ShellScanRule.java