That work is not useful work. It is rightly automated, but more in the sense of a design rules check. It is tragic that we waste people's time doing that. It is more tragic that this activity has not ceased to uncover vulnerabilities in production systems, because this shows we have learned nothing from the vulnerable patterns.
Clear, explicit specifications and output encoding help. Building simpler systems about which we can reason helps. An outside consultant critiquing the model helps.