Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection flags jar files with JndiLookup.class removed (but JndiManager.class present) #34

Open
leepfrog-ger opened this issue Dec 17, 2021 · 8 comments

Comments

@leepfrog-ger
Copy link

leepfrog-ger commented Dec 17, 2021

Thanks for the great tool!
I understand that the detection is done by checking for presence of the JndiManager.class in versions 2.1 and up.

However my understanding is that removing JndiLookup.class should be sufficient to mitigate the issue. I know that there is some conflicting information regarding this out there (whether to remove both the lookup and the manager class or only the lookup), but based on the official communication by apache removing the JndiLookup.class should be sufficient:

Otherwise, in any release other than 2.16.0, you may remove the JndiLookup class from the classpath: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class

https://logging.apache.org/log4j/2.x/security.html#CVE-2021-45046

Is there any concrete information out there that JndiManager.class really needs to be removed too? If not it could make sense to change the detection to be based on the Lookup's class presence for accurate results

@sirmb123
Copy link

sirmb123 commented Dec 17, 2021

You probably meant Is there any concrete information out there that manager really needs to be removed too?

@leepfrog-ger
Copy link
Author

You probably meant Is there any concrete information out there that manager really needs to be removed too?

Thanks, edited

@sirmb123
Copy link

That's a very good question by the way, I'm really looking forward for the answer.

@hillu
Copy link
Owner

hillu commented Dec 17, 2021

I suppose we could add back JndiLookup.class hashes…

@dracoqcca
Copy link

I suppose we could add back JndiLookup.class hashes…

What we want to know if if you have any sources that JdniManager.class is vulnerable or not? I have try to find it myself and didn't find any sign of it. Thanks for what you have done though really appreciate it.

@hillu
Copy link
Owner

hillu commented Dec 17, 2021

I think that my original assumption around JndiManager was based on the fact that JndiManager.java had been patched for 2.15 while JndiLookup.java had not.

In my attempts at reproducing the vulnerability (including the 127.0.0.1#. workaround)), JAR files with JndiManager.class removed could not be used to reproduce the RCE.

@leepfrog-ger
Copy link
Author

Thanks for your feedback. Some vendors rely on the guidance from Apache regarding removing the Lookup class as workaround. So it seems both to be sufficient and also the minimum required deletion. Therefore for our scanning we've added the Lookup classes too so that they are detected and then filtering on the log side to treat everything as not vulnerable that has at least the lookup class missing.

@tkboyle
Copy link

tkboyle commented Dec 22, 2021

Hi Hilko, I'd really like to see a filter against JndiLookup rather than JndiManager as we remediating by removing the JndiLookup.class but on re-run it's still finding a vulnerable version of JndiManager.class.

I've tried to change the hash info in filter.go before building to no avail.
Any help would be greatly appreciated

hillu added a commit that referenced this issue Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants