This should be considered as a weakness of the compression function, which is not a preimage resistant anymore. Sometimes, but not always, this may imply an attack on a hash function or a larger construction using this compression function.
For instance, consider the prefix MAC scheme, which is constructed out of a hash function $H$ as follows:
MAC_K(M) = H(K||M).
The prefix scheme is secure for some hash functions, for example the SHA-3 (Keccak) hash function.
However, if the compression function used by $H$ is not preimage resistant, then an adversary given $MAC_K(M)$ may recover the chaining value
and construct a valid MAC for any other $M'$ even though he does not know $K$.