News for hackers. Stuff that matters.
Re:Log4jscanner by yosito on Saturday January 01, 2022 @03:42PM (#29762510)
As someone who hasn't touched Java since a programming class 20 years ago, and mostly lives in the Node world now, with sprinkles of Python, is it enough to simply scan jar files? Do I need to worry about a Linux VPS running a Node app that might install some kind of Java dependency somewhere?
Re:Log4jscanner by cmeacham98 on Saturday January 01, 2022 @03:58PM (#29762693)
A Node or Python program could indirectly use a java library but it would be very unusual, and this library should catch it assuming any amount of sanity in how the dependency is installed.

Theoretically, some particularly insane application could download and run a jar purely in memory without it ever touching the disk. That's so close to malware-like behavior that only the most insane legit programs would ever do that.

Re:Log4jscanner by laurent92 on Saturday January 01, 2022 @06:15PM (#29763882)
Or someone running a plugin system. Ability to download plugins from the in-app experience, + storage in db + run from memory.
Re:Log4jscanner by foota on Saturday January 01, 2022 @07:38PM (#29764484)
Ironically, is this not how the log4j vulnerability works?
Re:Log4jscanner by xorcist on Saturday January 01, 2022 @04:04PM (#29762761)
It wouldn't be safe against an someone who actively tries to hide code, but the classloader requires the class files to be appropriately named, so if unzip -l doesn't show any suspect class names that should be enough in practice.

A Linux VPS running a Node app is unlikely to even have Java installed. It's a pretty big dependency and you couldn't miss it.

Re:Log4jscanner by yosito on Saturday January 01, 2022 @04:21PM (#29762961)
It seems like it would be easy to miss if it's in a docker container. Would auditing my docker containers be a good idea?

Also, is there a good command to run to reliably check if Java is installed on a system?

Re:Log4jscanner by edoceo on Saturday January 01, 2022 @04:36PM (#29763090)
> Would auditing my docker containers be a good idea

Yes! I frequently review any containers from the cloud I run. Load on isolated VM, start, cursory inspection at least. Then with images I'm happy with we keep them internally, until we need the upgrade.

Re:Log4jscanner by psYchotic on Sunday January 02, 2022 @09:48AM (#29769110)
May I suggest you look into grype[0], or some other similar tool? It can be used to scan images for vulnerabilities. You'll probably find a bunch of vulnerabilities that aren't likely to actually affect you, but still, at least you'll know they're in the images you're running. And maybe you'll start using things like docker-slim[1] on your own images to get rid of those vulnerabilities you do find.

[0]: https://github.com/anchore/grype

[1]: https://github.com/docker-slim/docker-slim

Re:Log4jscanner by needusername on Saturday January 01, 2022 @04:10PM (#29762825)
No. The JAR could be inside a WAR inside an EAR.
Re:Log4jscanner by throwanem on Saturday January 01, 2022 @04:34PM (#29763070)
Not to MAR the point you're making, but isn't that scenario pretty FAR from real-world PAR? I'm sure you find JARs in RARs and TARs too, especially from shady VARs, but at some point we're planning out SAR for when a meteor hits our CAR.
Re:Log4jscanner by ddworken on Saturday January 01, 2022 @04:43PM (#29763152)
This tool will recursively unpack wars and ears.
Re:Log4jscanner by ddworken on Saturday January 01, 2022 @03:57PM (#29762687)
One of the benefits of this tool is that you can run it across a folder or even an entire disk to check all jars on the disk. So if a Node app does somehow pull in java, by scanning the entire disk this tool should be able to detect if the pulled in java code contains log4j.