The security history of the JVM suggests that one shouldn't be optimistic there either.
the JVM is a bit special because there are a large amount of escape hatches, native code and a complex trust model, which has caused a lot of the exploits you end up seeing.
To put it mildly: There will be blood.