You absolutely need preimage resistance (both first preimage and second preimage) to have a functional merkle tree. Preimage resistance refers to finding hash inputs that give a given output. For an ideal k
bit hash the difficulty of first and second preimages is 2^k
. 128
bit hashes are fine here although multi-target attacks can weaken that bound a bit (more on that later).
A hash that was collision resistant but not preimage resistant would be very strange. Certainly it wouldn't work in a Merkle tree since a first preimage attack would allow splicing a new leaf into the tree.
If adversaries get to generate Merkle trees, they can deliberately cause collisions and then collision resistance becomes nessesary. This is the same as saying the Merkle tree is computationally binding(IE an adversary can't create two different trees with the same root hash). 128 bit hashes are no longer enough since collisions can be found with 2^64
work. For this you need 256
bits or at least 192
bits.
Randomised Hashing
To get better security bounds or handle untrusted data, some merkle trees incorporate pseudorandomly generated masks into their hashes. This technique is used in XMSS to improve the security bounds by adding a location based pseudorandom mask to all hash inputs and keying each hash with another pseudorandom value. This makes it harder to find preimages using a multi target attack since the attacker's attempts don't generalise across the entire tree.
When generating a Merkle tree with untrusted data, choosing a random salt with which to generate these masks will prevent the attacker from causing collisions by maliciously choosing leaf data values. So if the person choosing the salt is honest, collision resistance is not needed.