How is a Whonix Gateway corrupted?

Who can tell me more about how Gateways are corrupted? An attacker corrupted a Gateway making it dysfunctional but creating another as per the directions in the link below achieved victory. New Gateway functions as usual. But what did the attacker do and how do you avoid it?

Why is the Gateway template still viable?