oss-sec mailing list archives

Re: CVE-2021-44228: Apache Log4j2 JNDI features do not protect against attacker controlled LDAP and other JNDI related endpoints


From: Moritz Bechler <mbechler () eenterphace org>
Date: Fri, 10 Dec 2021 19:55:34 +0100

Hi,


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".


I also believe this should be Java 8u191, as only then remote classloading for LDAP was disabled by default. Only since then the direct remote classloading attack vector through JNDI injection is mitigated.

I put together a little post on the different JNDI attack vectors and how which Java versions are affected:
<https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/>

TLDR:
- Direct remote classloading through RMI up to 8u121 (and corresponding patch versions) - Direct remote classloading through LDAP up to 8u191 (and corresponding patch versions) - Runtime environment may provide exploitable local JNDI factory classes (Tomcat, WebSphere known) - Deserialization attacks are possible (if no global filter is applied), independent of runtime version

=> Do not rely on newer Java versions for mitigation, do patch immediately (or remove/disable the functionality)



Moritz


Current thread: