The security level of a cryptographic hash function has been defined using the following properties:
Given a hash value $h$ it should be difficult to find any message $m$ such that $h = hash(m)$. This concept is related to that of one-way function. Functions that lack this property are vulnerable to preimage attacks.
- Second pre-image resistance
Given an input $m_1$ it should be difficult to find different input $m_2$ such that $hash(m_1) = hash(m_2)$. Functions that lack this property are vulnerable to second-preimage attacks.
It should be difficult to find two different messages $m_1$ and $m_2$ such that $hash(m_1) = hash(m_2)$. Such a pair is called a cryptographic hash collision. This property is sometimes referred to as strong collision resistance. It requires a hash value at least twice as long as that required for preimage-resistance; otherwise collisions may be found by a birthday attack.
More details are in here.