Why is this hash function (based on a block cipher) insecure? I am new to hash functions and blockciphers and try to do some exercises to get a better understanding.

Considering the following block cipher if K is predefined value IV and the last ciphertext is the hash. I don’t really see how this hash function would be not secure but from what I heard block ciphers are only good hash functions if they use some sort of feed forward/backward with xor.

$C_1 = E_K(P_1)$
$C_i = E_{C_{i-1}}(P_i)$ for $i &gt; 1$

Why is this hash function – which is based on a block cipher – insecure?
If you want a hint as to why your proposed hash function isn't secure (even against preimage attacks), I would note that block ciphers are invertible, that is, given $C_{i-1}$ and $C_i$, we can efficiently compute the value $P_i$ must be so that $C_i = E_{C_{i-1}}(P_i)$ holds.  Question for you to complete the answer: how can an attacker exploit this to create preimages?