Wormhole attacks can negatively affect the localization in wireless sensor networks. A typical wormhole attack can be launched by two colluding external attackers, one of which sniffs packets at one point in the network, tunnels them through a wired or wireless link to another point, and the other of which relays them within its vicinity. In this paper, we investigate the impact of the wormhole attack on the localization process and propose a novel consistency-based secure localization scheme against wormhole attacks, which includes wormhole attack detection, valid locators identification and self-localization. We also conduct the simulations to demonstrate the effectiveness of our proposed scheme.