Sorry I don't understand how problem arises from bootloader being locked? Can you explain? Locked bootloader means less doors to exploit, cmiiw.
I wasn't referring to that, more like you can't customize a lot of things if your phone comes with a terrible OS. I guess my wording makes it unclear. For example, some manufacturers include ads on their OS, so you get bombarded with ads here and there. If you want to flash a newer or custom OS (including vanilla one with a higher version), you'll have to unlock the kernel, etc. Some of them don't support that. At least that's how it is when I'm still active on flashing custom ROM on my phones regularly.
In that case, I totally got what you meant. I got bored with my same old UI and the more I updated it the more downgraded the performance went. So I took the first daring step, unlocked the bootloader with Mi flash tool, sideloaded OrangeFox, and a custom rom, and before I knew it, I became a custom rom user. After that I never looked back, kept flashing custom roms every couple of days, tested different builds for the devs, and so on. So far I have tested over 50-100 roms, lost counting and none disappointed me, still using one. There was even one time, I installed Kali Nethunter, Lol.
As for this topic, IMO, a rom of vanila build would be the best to avoid such malwares. Because as you know, vanila build is of google free, so no play store integration, so less ways to get infected, not to mention it comes with latest security patch as well as Android version. The only problem regular users can't install it, and prefers the regular bloated OS which is being targatted now.
One thing that still surprises me and is beyond my understanding, how such small thing as RATs is able to accomplish such big tasks. It scares me. Just look at the blog, this Rat can do everything, from screen sharing to, tracking location, IPs, stealing credentials, hidden browsers, injection, and everything in the background, absolute control. The user wouldn't even notice a thing as I understood.
custom roms are basically dead for most new phones now unfortunately
No developer, no rom. And new phone doesn't need one anyway.