In this paper, a technique for detection of wormhole attacks based on distance verification is proposed for mobile ad hoc network (MANETs) applications. A node estimates its distances to a sender node based on the received signal strength (RSS) of received packets, and uses them to verify against the distances computed from the location information in the packets. The verification is formulated as a hypothesis testing problem and a Neyman-Pearson approach is used to decide whether the sender node is under wormhole attack or not. An implementation of the optimized link state routing (OLSR) protocol is discussed. A simple collaborative decision-making strategy is proposed to counter the limitations of distance verification by a single node. The proposed technique is computationally efficient. It is able to provide statistical performance measures for the detection results, an important component that has been missing in existing wormhole detection techniques. Finally, computer simulations are used to demonstrate the effectiveness and performance of the proposed technique.