What is the reason why Java and Flash runtimes were somehow more prone to malware but JS seems fine? Is it some specific sandboxing technology or something else entirely?
Flash suffered from not having a spec other than its implementation. Made it hard to fix bugs while being backwards compatible