Jail breaking is a deliberate and involved process, in some cases something that the manufacturer even allows for.
It’s not really the same as a random piece of JavaScript on a webpage jail breaking your phone. I think having a rootable device doesn’t inherently mean your device is insecure.