8/11
This problem 1st was addressed in BIP30.
Blocks are not allowed to contain a TX with the same ID as a previously not-spent TX.
While this solved some of the problems, it's still not enough.
Also, the BIP has specific exceptions for the above-mentioned TXs.