News for hackers. Stuff that matters.
Re:Why Is C Faster Than Java (2009) by lmm on Monday December 27, 2021 @12:19AM (#29699549)
Not a flaw in Java, a flaw in a specific overengineered logging framework. Relevantly, not a flaw that applies to JGit.
Re:Why Is C Faster Than Java (2009) by echelon on Monday December 27, 2021 @12:30AM (#29699640)
Runtime classloaders expose a huge blast radius. That's unfortunately a Java language feature.
Re:Why Is C Faster Than Java (2009) by marginalia_nu on Monday December 27, 2021 @07:13AM (#29701852)
I guarantee Java would be vulnerable to the same category of errors even without runtime class loaders. Java puts a lot of emphasis on dependency injection, and has done this for a fairly long time. This takes the form of having classes pull dependencies themselves through some central registry over explicit construction.

It's arguably a symptom of a larger problem the ecosystem's sheer size.

Re:Why Is C Faster Than Java (2009) by tsimionescu on Monday December 27, 2021 @02:48AM (#29700413)
As does dynamic linking, which is perfectly equivalent.
Re:Why Is C Faster Than Java (2009) by runeks on Monday December 27, 2021 @07:14AM (#29701861)
True, but that doesn’t make it better.
Re:Why Is C Faster Than Java (2009) by tsimionescu on Monday December 27, 2021 @01:24PM (#29705139)
Well, there are 0 languages that don't support dynamic linking, so I don't see why we would single out Java.
Re:Why Is C Faster Than Java (2009) by runeks on Tuesday December 28, 2021 @03:07AM (#29711569)
Dynamic linking is not a language feature, it’s a feature of the operating system. If we’re talking about dynamic loading, there are plenty of languages that don’t support this natively, but only through its C bindings (e.g. Haskell).
Re:Why Is C Faster Than Java (2009) by throwaway894345 on Monday December 27, 2021 @12:52AM (#29699798)
Not only a feature but an idiom.
Re:Why Is C Faster Than Java (2009) by larsrc on Monday December 27, 2021 @04:07AM (#29700830)
And made worse by static initializers being run when the class is loaded rather than when the class is first instantiated.
Re:Why Is C Faster Than Java (2009) by vbezhenar on Monday December 27, 2021 @04:57AM (#29701098)
Class is loaded when it's first instantiated, unless you're explicitly loading it.
Re:Why Is C Faster Than Java (2009) by lmm on Monday December 27, 2021 @12:54AM (#29699812)
Most languages' built-in serialization has similar issues, e.g. Python pickle.
Re:Why Is C Faster Than Java (2009) by throwaway894345 on Monday December 27, 2021 @01:21AM (#29699979)
Even if this is true, most languages don’t use dynamic code loading as often as Java.
Re:Why Is C Faster Than Java (2009) by lmm on Monday December 27, 2021 @01:48AM (#29700115)
In what sense? In many popular languages (Perl/Python/Ruby/...) all code loading is dynamic. Java does have more of a built in RMI framework than most languages, but it's rarely used in modern code.
Re:Why Is C Faster Than Java (2009) by nine_k on Monday December 27, 2021 @02:30AM (#29700326)
Pick a few random executables from your OS, check how many .dll or .so libraries do they dynamically link to.

For Python, JavaScript, Ruby, etc it's not even a question.

Re:Why Is C Faster Than Java (2009) by netheril96 on Monday December 27, 2021 @02:48AM (#29700411)
You practically cannot have the same vulnerability in C, because no one would bother implementing that kind of flexibility in C.
Re:Why Is C Faster Than Java (2009) by dtech on Monday December 27, 2021 @05:11AM (#29701170)
"Our language is harder to use than X, so it's safer because no-one will try to do certain things with it" is hardly a compelling defence.
Re:Why Is C Faster Than Java (2009) by rat9988 on Monday December 27, 2021 @10:06AM (#29703032)
It wasn't meant as a defence.
Re:Why Is C Faster Than Java (2009) by pjmlp on Monday December 27, 2021 @04:44AM (#29701016)
Another one that never saw the heyday of enterprise C code.
Re:Why Is C Faster Than Java (2009) by lmm on Monday December 27, 2021 @04:27AM (#29700939)
And if you disconnect your computer from the internet then it's safe from most remote attacks.
Re:Why Is C Faster Than Java (2009) by reyqn on Monday December 27, 2021 @06:16AM (#29701490)
Was there not a flaw in the jndi api for ldap? log4j was just the entry point from what I understood.
Re:Why Is C Faster Than Java (2009) by drdec on Monday December 27, 2021 @07:32AM (#29701968)
No, JNDI is an API for accessing remote code. It stands for Java Naming and Directory Interface. Not supporting LDAP, the most common remote directory, would have been a flaw.

The flaw was in log4j's use of the library which allowed remotely connecting and executing code by default based on connection strings which were possibly user-entered.

Re:Why Is C Faster Than Java (2009) by reyqn on Monday December 27, 2021 @06:49PM (#29708399)
Ok so JNDI's purpose is actually accessing remote code. You just have to not give it any untrusted data. It seems like a dangerous tool to use.