5 ms·
On one hand I want to be more forgiving of this, because log4j is very old, and likely this feature was introduced well before we all had a collective understan
by kelnos 5y ago
On one hand I want to be more forgiving of this, because log4j is very old, and likely this feature was introduced well before we all had a collective understanding of how fiddly and difficult security can be, and how attackers will go to extreme effort to compromise our services.
But at the same time... c'mon. A logging framework's job is to ship strings to stdout or files or something. String interpolation should not be this complicated, flexible, whatever you want to call it. The idea that a logging framework (!) could even have an RCE makes me want to scream... the feature set that leads us to that even being possible just weeps "overengineered".
- JanecekPetr 5y agoNo, this is about log4j2 which is kinda new (2.0.0 was released 2014). Otherwise, yeah, this is terrible, especially since the tag doesn't even have to be in the formatting string.
- maxdamantus 5y agoThe sample in the in post is log4j1 ("org.apache.log4j" rather than "org.apache.logging.log4j"), which is why it's using: > log.info("foo: " + bar); rather than: > log.info("foo: {}", bar); But the issue also affects log4j2, and it doesn't matter which form of logging you use, since the transformation apparently happens further along in some appender, used by both versions of log4j.
- Zardoz84 5y agoThe post examples its : log.info("Request User Agent:{}", userAgent); Also, I just try with log4j1 , and I can't reproduce it. At least with the netcat trick doesn't work : https://twitter.com/thetaph1/status/1469264526214406150?s=20 https://twitter.com/thetaph1/status/1469264526214406150?s=20
- maxdamantus 5y agoThe post has been partially updated to log4j2 [0] (the import is still log4j1, but I imagine this will be updated soon [1]). And yes, I'm actually not sure log4j1 is vulnerable. I assumed it was because the sample code in the post was using log4j1, though the description only explicitly mentions log4j2. [0]: https://github.com/lunasec-io/lunasec/pull/270 https://github.com/lunasec-io/lunasec/pull/270 [1]: https://github.com/lunasec-io/lunasec/pull/277 https://github.com/lunasec-io/lunasec/pull/277
- whizzter 5y agoEven if 2.x is the main culprit right now some one twitter started testing and it seems that 1.x might be exploitable as well.
- cpu_ 5y agocan you share a link to the tweet/source?
- whizzter 5y agoNah it's long gone, however I've later read that the 1.2 series was declared deprecated long ago and after that there was an exploit for 1.2 released in 2019, not entirely sure if it was ever patched so that might've been the source.
- michaelt 5y ago> A logging framework's job is to ship strings to stdout or files or something. I've seen people (including here on HN) dismiss libraries as "abandoned" when they went a year without a release. The software industry will never get bug-free, feature-complete software so long as we're selecting for the opposite.
- ironmagma 5y agoCode is alive and there’s typically always something to do: adding tests, removing bugs, or simply paying back technical debt. If you go a full year without any releasable changes, chances are the project has been abandoned.
- lanstin 5y agoMy goal is to write servers that get uptimes more than a year. Like the old saying, peefection is reached not shem there is nothing left to add but nothing left to delete.
- toyg 5y ago> peefection Unrelated, but your typo made me think that "Peerfection" would be a great name for a P2P program.
- blktiger 5y agoNot only that, but no release in the last year is likely to be missing fixes for security issues on any sufficiently complicated project.
- watwut 5y agoWhy would you paid back technical debt on something where you don't intend to add features into or don't have serious bugs? This idea that it must be changing forever is literally why you can't have simple done tools. Cause they will be considered abandoned once they do that one thing.
- 5y ago
- wbl 5y agoThe Ware report is 60 years old. String formatting bugs are about 20 or 30.
- adamc 5y agoIsn't it from 1970? So, 51 years old.
- rst 5y agoThe patch which apparently introduced the vulnerable code path landed in 2013 -- https://www.lunasec.io/docs/blog/log4j-zero-day/ https://www.lunasec.io/docs/blog/log4j-zero-day/ For context, injection attacks were on the original OWASP top 10 list from 2003.
- ta4873588478 5y agoYeah this is disappointing to hear about and isn't a good look for the people involved. At the very least it should've been a separate module or an opt-in configuration parameter, who the hell needs a JNDI lookup in a log statement. If you do, do it yourself then log it. Disappointing.