…with a devastating weapon able to destroy any star system while hidden in the depths of space.
I’m not enamored with “while hidden in” for some reason either, but I’m not sure what I’d replace it with.
Maybe something like:
…with a hidden superweapon, capable of destroying any star system from across the galaxy.