Stock roms are really unsafe with root because they are not made and optimized to be used with root access. Therefore it's always recommended to flash a secure custom rom. You can try lineage OS.. regarded as very secure.
I believe that custom open source Android ROMs like Lineage OS are secure just because of the fact that their full source code is open source.
And the professionals and hobbyists out there definitely would check and ensure that it has no secret bugs.
The developers would also not like to damage their reputations by open sourcing a software with spywares that everyone including the topmost brains in the world can scrutinize.