Length extension attacks make sense for a key derivation function. For a good KDF, we expect that sub-keys are indistinguishable from randomly generated keys even if the attacker provides the info values. Suppose we limit ourselves to the tasks of key expansion; that is, we want to create sub-keys from a random primary key. A simple and elegant way to solve this is to use a secure pseudo-random function $f$ and generate subkeys $k_i = f(k, info_i)$. Now $f$ may be vulnerable to length extension that is given $f(k, x)$, it is possible to compute $f(k,x|y)$ without knowing $k$. Cleary outputs of $f$ are not indistinguishable from random values if the attacker controls the info value. Here's a distinguisher $D$ that works with overwhelmingly high probability.
- $D$ queries the KDF on input $x$ and gets $k$
- $D$ performs a length extension attack for $k, y$ assuming the KDF is $f$ and gets $k'$
- $D$ queries the KDF on $x|y$ and gets $k''$. $D$ asserts that the KDF if $f$ if $k' = k''$.
It's clear that if $f$ has length-extension vulnerabilities, the outputs of $f$ are not indistinguishable from random. Hence $f$ is not a good KDF. Note that $f$ may still be a good KDF if we put some restrictions on the info value.
In general, KDF security roughly considers an adversary with some information about the entropy source and knows the salt. In one experiment, the adversary is given a key derived from using some entropy source, a salt and an info value provided by the attacker (only the info value); in the other, the adversary is given a randomly sampled key. Furthermore, the adversary can ask for other keys derived from the same randomness source. So if the KDF has the length-extension property, it's theoretically broken. This might also be a practical issue in certain circumstances.
The prefix-key KDF is not secure without restrictions on the info value. That is because given $k = k_1|k_2|...|k_n$; the attacker can mount a length extension on each $k_i$ when the hash is an MD hash. However, if all the info values were restricted to a prefix-free set, this would be a secure KDF. The reason is that key MD hash is also a cascade of PRF evaluation under the assumption that the compression function is a PRF which is a very reasonable assumption if the compression function is built following the Davis-Meier paradigm.