Live data from Hacker News

Log4j 2.15.0 – Previously suggested mitigations may not be enough

isc.sans.edu

61–70 of 103 posts

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#61
Why is nobody still concerned with the fact that log4j-core is nearly 50 KLOC big and massively overengineered? A bit much for a logging library, isn't it?

How many users of this library even know 10% of what's going on in there?

For a comparison, the entire original Doom was only 40 KLOC. https://www.reddit.com/r/Doom/comments/g7wbxr/number_of_line...

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#62
post #61

Why is nobody still concerned with the fact that log4j-core is nearly 50 KLOC big and massively overengineered? A bit much for a logging library, isn't it? How many users of this library even know 10% of what's going on in there? For a comparison, the entire original Doom was only 40 KLOC. https://www.reddit.com/r/Doom/comments/g7wbxr/number_of_line...

You can apply the same logic to most of the stack of most of everything.

Not to downplay the issue, but it's hardly an isolated case. Noone cares until they have to care, and by that point it's too late.

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#63

This vulnerability will likely turn out to follow the trajectory of the Meltdown and Spectre vulnerabilities from...(checks google)... 2018. I speculate will be a cluster of newly discovered vulnerabilities that follow a similar pattern, possibility across a number of familiar Java libraries.

What I have been pondering again in the past few days is dependency management. For many projects this is a open pom file pop in the new version, recompile, deploy and bobs your uncle you are good. But some projects are little more interesting in that they include libs like this, or include libs that include it. It is part of their foundation/framework. So you can still put in override and ignore what the lib wants.…

There isn't one. This method of development inherently leads to these kinds of problems. Software engineering is still in its infancy and has yet to truly develop a universal best practice development cycle. Eventually these things will be codified.

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#64
post #56
post #26

In other news: If I can intercept the log messages (unencrypted remote syslog, or log file public accessible, log messages also shown to the user) I can still just inject stuff like "${env:DATABASE_PASSWORD:-xxx}". Lots of people are only focusing on the aspect how this can be abused to inject arbitrary code, while it is actually a similar class like SQL injections: Blindly trusting user input instead of doing proper…

Are you saying that log4j is also used for analyzing logs that have already been generated ? My understanding was that it was intended for use inside an application for generating log messages and processing them before they are sent out to a file or syslog.

I had the same thought. However, I think it's a more generic attack. If you can persist or inject the jdni strings, there's a chance they will be emitted by another component which analyzes the logs and has a log4j dependency elsewhere in the stack.

I've heard people talk about this problem with analyzing windows event logs using Java-based software.

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#65
post #43
post #26

In other news: If I can intercept the log messages (unencrypted remote syslog, or log file public accessible, log messages also shown to the user) I can still just inject stuff like "${env:DATABASE_PASSWORD:-xxx}". Lots of people are only focusing on the aspect how this can be abused to inject arbitrary code, while it is actually a similar class like SQL injections: Blindly trusting user input instead of doing proper…

Please stop suggesting that SQL Injections are a sanitization problem. They are a problem of escaping in the application constructing the query, not a problem with whatever the user has typed in. The log4j vulnerability shares some common traits, but it's completely different at the core. It's not a problem of sanitization, and I'd argue it's not a problem of escaping either (though escaping could fix it). It's a pro…

I disagree with you: IMHO "escaping user input in the application constructing the query" is one possible form of sanitization. Why do you think it is not?

Also I said "similar class", not "strictly equivalent". Both instances are a case of "user input handled as code, not as data". Now with SQLi the problem is widely known (but sadly still happens) and we have techniques like parameter binding to outright avoid the problem. The same techniques are among the theoretical possibilities to avoid the problem with log4j.

Though I agree, the problem are the insecure defaults (JNDI enabled) and that seemingly every java dev used log4j but wasn't aware of the "${}"-expressions. I just pointed out that this "trend of neglect" [sry, non-native speaker here, but I hope you get what I mean?] seems to continue: Everyone and their CISO is now aware that attackers can abuse JNDI and the whole mitigation recommendations (e.g. remove JDNI classes) so far was primarily focused on that. Still, even if JNDI wasn't a thing, the "${}"-expressions can still be abused (it's just more specialized now and not a huge pwn fest), requiring mitigations beyond disabling JNDI. Just look at the reporting for more examples of ignorance: When this started to explode, there were some who thought blocking the string "${jdni" in their WAF would be enough (and maybe it helped against script kiddies), but a smart attacker just used/uses a string like "${${env:randomstring:-j}dni[...]" defeating the simple filters...

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#66

Earlier quoted context omitted.

The major risk here probably isn't in-house developed code but versions of log4j used in a vast array of packaged software and systems. https://github.com/cisagov/log4j-affected-db <-- that's a (probably incomplete) list of possibly affected vendors and applications, and in many cases the vendor can't even say yet whether they're vulnerable.

Yup. Here's a concrete example -- my team owns a couple of java services. They're spring boot with slf4j as our logging wrapper, using the default logging implementation of logback -- we didn't opt for log4j. So we're good, right? Well, let's do a `gradle dependencies` and see if we're pulling it in transitively -- still good. See some `log4j-api`, but no `log4j-core`. We're not actually doing any logging with log4j…

You're now making me feel better about our decision to exclude the log4j-api from our spring build entirely.

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#67
post #43
post #26

In other news: If I can intercept the log messages (unencrypted remote syslog, or log file public accessible, log messages also shown to the user) I can still just inject stuff like "${env:DATABASE_PASSWORD:-xxx}". Lots of people are only focusing on the aspect how this can be abused to inject arbitrary code, while it is actually a similar class like SQL injections: Blindly trusting user input instead of doing proper…

Please stop suggesting that SQL Injections are a sanitization problem. They are a problem of escaping in the application constructing the query, not a problem with whatever the user has typed in. The log4j vulnerability shares some common traits, but it's completely different at the core. It's not a problem of sanitization, and I'd argue it's not a problem of escaping either (though escaping could fix it). It's a pro…

[deleted]

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#68
post #45
post #43

Earlier quoted context omitted.

Please stop suggesting that SQL Injections are a sanitization problem. They are a problem of escaping in the application constructing the query, not a problem with whatever the user has typed in. The log4j vulnerability shares some common traits, but it's completely different at the core. It's not a problem of sanitization, and I'd argue it's not a problem of escaping either (though escaping could fix it). It's a pro…

Yeah, people should stop talking about sanitation in relation to SQL, because that is how we end up with data like "OConnor". The two correct solutions are escaping and parametrization/prepared statements (i.e. sending the parameters out of band).

Huh? I understand "sanitation" to mean "a transformation of data that makes the data safe for use in the subsequent program". Escaping is one way of doing that transformation, and it's good because it's not lossy.

Another example: A "transformation" that's a "sanitation" but not "escaping" would be replacing all occurrences of "(btw, thanks for that it's "sanitation" and not "sanitization" ^^).

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#69
post #68
post #45

Earlier quoted context omitted.

Yeah, people should stop talking about sanitation in relation to SQL, because that is how we end up with data like "OConnor". The two correct solutions are escaping and parametrization/prepared statements (i.e. sending the parameters out of band).

Huh? I understand "sanitation" to mean "a transformation of data that makes the data safe for use in the subsequent program". Escaping is one way of doing that transformation, and it's good because it's not lossy. Another example: A "transformation" that's a "sanitation" but not "escaping" would be replacing all occurrences of " (btw, thanks for that it's "sanitation" and not "sanitization" ^^).

I've seen "sanitization" used to often mean filtering or removal of some of the input

Re: Log4j 2.15.0 – Previously suggested mitigations may not be enough

#70

I must confess to feeling that the reach of this CVE is a bit oversold. Yes, it's a terrible RCE and a major catastrophe for anyone using log4j. But log4j hasn't been the popular choice for logging implementations in a long time. Libraries typically use facades like slf4j or commons-logging, so the risk of pulling in an active log4j implementation transitively is pretty small. Your application/appserver either logs w…

The fact that putting these strings in the name of an iPhone or a Tesla was vulnerable suggests to me that there are plenty of vulnerable systems out there.

https://www.theverge.com/2021/12/13/22832552/iphone-tesla-sm...

Post reply on HN