It follows from how Merkle-Damgard hashes keep their internal state. HMAC is the standard fix.