196
u/j0zeft Dec 13 '21
Back at my last job, I worked with a Java team for 3 days every week, and I was the only .NET guy. There used to be a stand up every day, and a shit on .NET round right after! It was quite toxic for real. Today, exactly 8:30, I went and texted the main 3 jerks with just “Good morning 🙃”. None of them replied, and one of them blocked me on WhatsApp
23
40
13
78
u/Willinton06 Dec 13 '21
Serilog must be popping champagne right now
74
u/botterway Dec 13 '21
I suspect they're going through their code with a fine tooth comb and a security viewpoint.
32
u/neoKushan Dec 14 '21
Just wait until someone finds a vulnerability in Newtonsoft.json.
8
u/Willinton06 Dec 14 '21
2014 called they want their serialization back
2
17
Dec 13 '21
Been using them for years. I can't imagine not using them. Great system and support, always update to use the latest .NET standards. Documentation is up to date and accurate.
I love them so much ;_;
5
17
u/m1llie Dec 13 '21
I'm patching a bunch of legacy Java applications at my organisation now. Gradle makes me want to scoop my eyes out of their sockets with a melon baller.
16
u/discourse_is_dead Dec 13 '21
what about log4net ? :O
28
u/TimeRemove Dec 13 '21
I don't believe there could be an issue. The problem here is with the interaction between Log4J and Jndi (Java Naming and Directory Interface). So unless log4net went out of their way to port Jndi, I cannot imagine it would be a problem.
15
12
u/rebornfenix Dec 13 '21
From everything I am reading, the Log4J is somewhat like the Newtonsoft.Json “vulnerability” when sending the class name in the json object. (NOTE: this is not a default configuration and the readme page on it says this can (will) open a remote code execution vulnerability in your code because of how it uses reflection and dynamic instantiation). Basically if you pass in an object and a method on that object as a json property, newtonsoft will call that method in deserialization passing the value as the parameter to the method. (Again, only if a non standard config setting is set and there are lots of warnings on that feature.)
The Log4J issue is similar. The JDNI deserializer has an issue where if the right string is sent to the logging provider, the JDNI deserializer will execute code. That can be leveraged into a full remote code execution vulnerability to download a random jar and kick it off. So as far as anyone knows, Log4Net is not vulnerable.
11
u/HaveYouSeenMySpoon Dec 13 '21
Isn't this basically why BinaryFormatter was deprecated and recommended never to be used?
6
3
u/Genesis2001 Dec 14 '21
The Log4J issue is similar. The JDNI deserializer has an issue where if the right string is sent to the logging provider, the JDNI deserializer will execute code. That can be leveraged into a full remote code execution vulnerability to download a random jar and kick it off.
So log4j (or Oracle?) isn't sanitizing their strings or? Sorry, I'm not a Java programmer, so idk what JDNI is. I assume it's something Oracle/Java provide or is it an added library?
3
u/rebornfenix Dec 14 '21
Basically. It works very similar to a sql injection vulnerability but on the app server in Java land. So instead of just getting extra data from the db server (not good) you can have code download more code and establish a reverse shell with the permissions of whatever application account the app is running under with out needing to do anything more than sending a specially formatted string in the user agent header (for web servers that have a vulnerable version and log the user agent string of every request).
Add on to that it’s the “default” logging provider for Java. There are others out there but log4j is the most popular
2
u/Genesis2001 Dec 14 '21
How's this affect containerized applications running in docker? [default/OOBE configuration]
The only app my org has that is possibly affected is keycloak, which runs in a docker container. However, it uses 1.x according to the relevant GitHub issue.
4
u/rebornfenix Dec 14 '21
The vulnerability will allow remote code execution inside the container. At that point, an attacker can work to exploit another system on the network and server hop to something not a container.
So still bad and needs to be patched but the infected container can be killed and a clean container spun up. It’s the jump to something permanent that you need to worry about.
1
Dec 14 '21
As I understand it you can send little command with log4j message strings, like add the current version to error message etc one of the command is to go to a given jndi server and download a configuration class. So it does that, deserializes and then executes it. Boom exploit.
6
Dec 13 '21
Nope. The vulnerability is entirely based on the handling of property substitutions that Log4net doesn't even support.
1
6
u/edbutler3 Dec 14 '21
Wonder how many people still use log4net? I was forced to move to NLog years ago due to a log4net vulnerability that remained unpatched for a very long time. I watched the Apache mailing list for a while and saw that a guy eventually stepped up and and did a new log4net release for the first time in, IIRC about 2 years. Then the thread went quiet. I eventually unsubscribed since I'm not using it anymore, but my takeaway was that it's virtually a dead project.
2
u/FullStackDev1 Dec 14 '21
In my case, I went with NLog years ago, because log4net configuration was convoluted as f**k in comparison. I remember being a bit hesitant, because at the time (it was probably 10 years back), nobody was in charge of the project, but a while later someone picked it back up and it seems to be thriving since then. Easy to use, with extensions for pretty any major 3rd party integration.
1
u/discourse_is_dead Dec 14 '21
So I should be switching to NLog then? I was a big fan of Log4Net integrated with graylogs but Nlog could do the same thing for me.
4
4
u/chucker23n Dec 14 '21
I would recommend looking at both NLog and Serilog and then deciding which fits your taste better. Either will be fine. Log4Net seems… legacy.
1
u/discourse_is_dead Dec 14 '21
the setup is a bit lengthy for log4net. ugh..
Thanks i'll check both out
6
4
4
Dec 13 '21
I'm over here just thinking, what exploits are out in the wild that haven't been discovered yet?!?!?!
I'm not paranoid!!! JET FUEL DOES NOT MELT STEEL BEAMS
errrr
7
1
u/vplatt Dec 14 '21
what exploits are out in the wild that haven't been discovered yet?!?!?!
All of them. :D And all the ones we thought we fixed a while back? Yeah, those will come back occasionally too. It's just the circle of life.
4
7
3
u/TheC0deApe Dec 14 '21
this meme plays well for homework, smaller shop, someone that sells .NET desktop apps (do they exist still), etc.
this doesn't play well if you have lots of .NET deployed in a cloud solution. you could start realizing mongo, redis, elsasticsearch, neo4j, ActiveMQ, Kafka and more enterprise solutions have log4j shipped with them. then you get to go through each product and make sure it isn't a problem.
a small java shop will just have to update their code packages. anyone in a large enterprise is having issues no matter who what language they write.
5
u/quadlix Dec 13 '21
Similarly, this applies to the Equifax breach from '17 and subsequent meltdown for all Struts folks.
2
u/FullStackDev1 Dec 14 '21
Years ago I was tasked with picking the logging framework for our app. The choice was before Log4net and NLog. Ended up going with NLog, because I found it much more intuitive to use. We're still using it to this day.
2
u/illathon Dec 14 '21
Why do people keep using this Indian guy as a alpha? He isn't. He is a plastic surgery reject. haha
1
Dec 13 '21
I hate a lot of things about C#/.NET/NuGet but I am sure happy right now that we are a C# shop and not a single of our services runs Java/log4j. Phew!
5
1
u/darkfate Dec 13 '21
Unless you're like me and also have Mulesoft services in the mix that run on Java. I'm assuming most development that includes web today has to worry about more than only .net vulnerabilities, but Javascript library dependencies (good luck when you have 10k+ dependences in npm, even with security scanners). It almost makes me miss writing exclusively VB.NET desktop applications connecting to ASMX services also written in VB.NET
-10
u/throwawayskinlessbro Dec 13 '21
⠀⠀⠘⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀ ⠀⠀⠀⠑⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠁⠀⠀⠀ ⠀⠀⠀⠀⠈⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠴⠊⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⢀⣀⣀⣀⣀⣀⡀⠤⠄⠒⠈⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠘⣀⠄⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠛⠛⠋⠉⠈⠉⠉⠉⠉⠛⠻⢿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿ ⣿⣿⣿⣿⡏⣀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿ ⣿⣿⣿⢏⣴⣿⣷⠀⠀⠀⠀⠀⢾⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿ ⣿⣿⣟⣾⣿⡟⠁⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣷⢢⠀⠀⠀⠀⠀⠀⠀⢸⣿ ⣿⣿⣿⣿⣟⠀⡴⠄⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⣿ ⣿⣿⣿⠟⠻⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⢴⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⣿ ⣿⣁⡀⠀⠀⢰⢠⣦⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⡄⠀⣴⣶⣿⡄⣿ ⣿⡋⠀⠀⠀⠎⢸⣿⡆⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⠗⢘⣿⣟⠛⠿⣼ ⣿⣿⠋⢀⡌⢰⣿⡿⢿⡀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⡇⠀⢸⣿⣿⣧⢀⣼ ⣿⣿⣷⢻⠄⠘⠛⠋⠛⠃⠀⠀⠀⠀⠀⢿⣧⠈⠉⠙⠛⠋⠀⠀⠀⣿⣿⣿⣿⣿ ⣿⣿⣧⠀⠈⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠟⠀⠀⠀⠀⢀⢃⠀⠀⢸⣿⣿⣿⣿ ⣿⣿⡿⠀⠴⢗⣠⣤⣴⡶⠶⠖⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡸⠀⣿⣿⣿⣿ ⣿⣿⣿⡀⢠⣾⣿⠏⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠉⠀⣿⣿⣿⣿ ⣿⣿⣿⣧⠈⢹⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿ ⣿⣿⣿⣿⡄⠈⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣦⣄⣀⣀⣀⣀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠙⣿⣿⡟⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠁⠀⠀⠹⣿⠃⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⢐⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⠿⠛⠉⠉⠁⠀⢻⣿⡇⠀⠀⠀⠀⠀⠀⢀⠈⣿⣿⡿⠉⠛⠛⠛⠉⠉ ⣿⡿⠋⠁⠀⠀⢀⣀⣠⡴⣸⣿⣇⡄⠀⠀⠀⠀⢀⡿⠄⠙⠛⠀⣀⣠⣤⣤⠄⠀
0
Dec 13 '21
[deleted]
18
u/jantari Dec 13 '21
I've also discovered this on our 2019 deployments and similarly can't tell what it's for. It's in some DTS-Extension directory but I'm no DBA and couldn't find the purpose of those files.
Anyway, log4j 1.x has been EoL since 2015 and all versions of it are vulnerable to https://nvd.nist.gov/vuln/detail/CVE-2019-17571 which is basically the same deal as Log4Shell so it's still very questionable why the fuck a vulnerable and end of life java library ships with SQL 2019
7
u/pinghome127001 Dec 14 '21
Interesting. I mean, its java, so how the fuck does it run if i will not have java installed ? Does sql server also include its own java version ?
3
101
u/TimeRemove Dec 13 '21
Ick. Just use the best technology for the job, .Net is good enough on its own without this inferiority complex crap.
I'd also caution cheering for this as if anything it showcases that managed languages aren't the panacea some claim and quite serious security problems can occur (in this case an RCE). Try to take away from this that whenever you dynamically load code using strings, you should use extreme caution if those strings are generated at runtime (and should ideally never be user-supplied).
This could and has happened with .Net. For example XML parsing libraries on .Net have had problems in the past with a similar issue (XXE injection).