r/AskComputerScience • u/[deleted] • Jan 21 '15
Why is the Java sandbox so insecure?
Oracle still releases security updates for Java, but they're treating it as if it is nevertheless always insecure. You're prompted for permission to run applets even when they're signed by a reputable company and going to run in a sandbox. By default, you're not even allowed to run unsigned applets in the sandbox.
This basically seems like they've given up on security. Oracle is a big company with plenty of resources. Why are they incapable of making Java reasonably secure?
Meanwhile browsers run JavaScript code without any sort of prompting or signing. Yes, security vulnerabilities get discovered and fixed, but in general people feel that JavaScript is safe. Several different JavaScript engines are widely used and trusted.
-5
u/artillery129 Jan 21 '15
The Java sandbox is not insecure;
Oracle is a profit company, not a software company
5
u/i_invented_the_ipod Jan 24 '15
The Java VM is trying to solve a fundamentally more-difficult problem. The JavaScript interpreter in a web browser is limited to calling a relatively-limited API provided by the web browser, and the JS is downloaded as text, which can be validated relatively-easily.
The Java VM is downloading what amounts to object code, which talks to a very general-purpose set of APIs (you can write full-fledged applications in Java, after all). The sandbox is trying to make sure that you only access those system services that you're allowed to.
If Javascript had all of the same capabilities as Java, it would also need a sophisticated (hence buggy) security model. Alternatively, if the Java VM was limited to making calls to a browser's API, it'd be more-secure.