News for hackers. Stuff that matters.
Re:Don't run 'strings' on untrusted files by kyllo on Saturday October 25, 2014 @06:17PM (#8509570)
The most popular implementation of the JVM itself is written in C++. But more importantly, Java has experienced a multitude of serious security bugs over the years.
Re:Don't run 'strings' on untrusted files by _delirium on Saturday October 25, 2014 @07:14PM (#8509704)
I'm not a huge JVM fan, but the majority of the Java vulnerabilities are related to a very different threat model that many languages don't even purport to guard against: safely running code that you know may be directly written by an adversary. The Java SecurityManager is supposed to allow that by sandboxing code with limited permissions, but has had a number of bugs, some of which can be exploited to let malicious apps break out of the sandbox. That's bad for cases where you are actually relying on running potentially malicious code, like applets in browsers. But not too relevant to the case where you'd be considering whether to choose Java, C, or C++ for a desktop or server app. In that case, treating the app itself as potentially malicious is not a common threat model: people don't normally run C/C++ apps in a sandbox. Although I suppose with the rise of Docker that might start becoming plausible for certain apps, relying on some OS facilities rather than a VM to do the sandboxing.
Re:Don't run 'strings' on untrusted files by snuxoll on Sunday October 26, 2014 @01:26PM (#8511595)
There's already been multiple security vulnerabilities in Docker, and likely there will continue to be more in the future. Virtualization and sanboxing is hard!
Re:Don't run 'strings' on untrusted files by pjmlp on Sunday October 26, 2014 @05:18AM (#8510612)
>The most popular implementation of the JVM itself is written in C++.

The amount of C++code decreases with each release.

For example, the version 8 of the OpenJDK had quite a few code rewritten in Java, thanks to the work introduced with invokedynamic.

There are plans to eventually replace Hotspot with Graal and SubstrateVM, in some future version of the OpenJDK, thus reducing even more the C++ surface.

This is why project Sumatra is using Graal and now jRuby is also playing with it.

Re:Don't run 'strings' on untrusted files by jerven on Sunday October 26, 2014 @09:06AM (#8510927)
The vast majority of which where actually in parts of the C++/C code used to implement the most popular implementation of the JVM. Which is in C++ for historical reasons not because C++ is needed to implement a JVM.

And as other commenters note the amount of C++ decreases each release because its less and less useful to have any code in the JVM as C++.

In graal calls to the OS are going to more limited in surface area than in Hotspot C2.

For all reasons removing a class of errors e.g. buffer overflow leading to executable code is going to give more secure code.

Not that I think Java is a silver bullet that will solve all problems. I do think that a language like Java or Rust is a major improvement over C with minimal performance issues.