Recently, Lin et al. proposed a quantum protocol (Quantum Inf Process 13:239, ), which can compare the secret data of Alice and Bob without the help from a third party. Here it will be shown that the protocol is insecure. Both Alice and Bob can learn the secret of the other party without being detected.