This document presents a Wormhole Attack Detection Algorithm (WDA) for wireless ad hoc networks, emphasizing the vulnerabilities to security threats such as wormhole attacks that can disrupt routing protocols like AODV. The proposed algorithm detects suspected wormhole nodes by measuring round trip delays during packet transmission and involves a confirmation mechanism to differentiate delay caused by congestion from that caused by attack. The study includes simulation results demonstrating the algorithm's effectiveness in maintaining packet delivery ratios despite the presence of wormhole attacks.