I remember the times when Javascript usage was so innocent; a small pop-up here, a dialog message there.
Nowadays Javascript "steals" data by exploiting vulnerabilities on "mature" browsers such as Firefox (prior to 39.0.3.), and making the world under alert.
The vulnerability comes from the interaction of the mechanism that enforces JavaScript context separation (the “same origin policy”) and Firefox’s PDF Viewer. Mozilla products that don’t contain the PDF Viewer, such as Firefox for Android, are not vulnerable. The vulnerability does not enable the execution of arbitrary code but the exploit was able to inject a JavaScript payload into the local file context. This allowed it to search for and upload potentially sensitive local files.
Or just by visiting a website you get a malware as a gift:
You can get a virus just by visiting a site in Chrome or any other browser, with no user-interaction needed. Even with Chrome you are not 100% secure - and you probably never will be with any browser, but Chrome is getting pretty close to it and the security research community seems to agree that at this time, it is the most secure browser you can use.
- Based on that, I wonder if JavaScript is too dangerous to be used on browsers or if browsers themselves are too insecure?
- Would it be possible to limit what JavaScript can do from a browser configuration perspective (e.g. Automatically start a download or references to scripts on other domains [High threat])?