I can slip one line of code into a modern website that'll target a particular iphone model and run its battery to nothing in half an hour, and probably crash safari as well. Any language is susceptible to badly written or malicious code. At least with Flash it was in a box, in a virtual machine, and you had to approve it and could kill it at any time.