Most of the recent jailbreaks involve Safari vulnerabilities, so you don't even need to install an app to compromise your iPhone, the walled garden is just security through obscurity.
We can also see that Apple were unable to protect their OSX devices as a result of allowing third-party app installations.