It's tricky, because most phones can't be flashed with an alternative aftermarket OS. I know that LineageOS etc. exist, but most phones don't have a stable build and a lot of SoCs will never work reliably with an aftermarket OS.
In that case whoever will exploit your phone first is the one who owns it, not you.