Java is not immune to those problems. It has its own share of problems. And maybe C++ has some problems that Java doesn’t have, but that part is solved by Rust. And Rust is generally safer than Java.
If dependencies are NOT allowed not use native code - they are slow and so my Java program is. If dependencies ARE allowed - Java is the same “vulnerable” as other languages. If dependencies turring-full compiles JIT into native - it’s impossible to audit
Well take for context that the response above is framed by the way the first person framed it.
If dependencies are NOT allowed to use native code
They are pure Java and are optimized like the rest of your program. Probably worst case it's like 2.5x slower or something. It's not Python where it's 50x (and like I alluded, sometimes it's 1x or 0.9x. really depends on the code)
If dependencies are allowed to use native code
You have to explicitly add a flag to enable it, so at least you are aware that you have a different risk profile than pure Java
You can have that flag be per-library so you know exactly what you need to audit deeply to have confidence you don't have buffer overflows
And in both situations
you need to trust the native code in the VM. But at least that's only one "thing." Let's audit it more, of course. Or find ways to make it safer by construction. But it does make it so most people don't need to go to these depths.
View all comments
61
u/BenchEmbarrassed7316 4d ago
What a nonsense.
tldr: A vulnerability was found in Java. Java isn't much slower than C++. So, use Java.