The root cause is the complete lack of facilities to quickly and simply delegate capabilities to applications. There is no way to tell the OS, give this file to this application. Instead of trusting nothing, and providing the PowerBox facility to allow the user to do this, all the popular OSs just trust the applications with everything that the user has permissions to access, by default.
---
If you want to pay for a purchase at a store with cash, you carry a number of units of currency... and you only give the clerk the appropriate amount, and you can count the change to verify the transaction is correct.
Giving you a person, access to your cash is a solved problem. 8)
There is no equivalent way to work with an application on mainstream OSs. This is collective insanity, which I've been calling out for more than a decade.
I would argue that at least some of those holes were indeed imagined, that’s why iOS works the way it does and not the way parent would like.