We propose a novel non-parametric solution for accurate distance-based source localization in wireless sensor networks (WSN's). The proposed technique includes a method to detect whether or not ranging is affected by bias due to non- line-of-sight (NLOS) conditions, requiring no a-priori knowledge of distance estimate statistics. Instead, we exploit the triangular inequality property of the Euclidean space and employ hypothesis testing (HT) in order to derive confidence levels on the observations and classify each link in the network as LOS or NLOS. These confidence levels are then incorporated in the formulation of an iterative WLS (IWLS) algorithm for WSN localization. The combination of the two contributions proves a powerful WSN localization algorithm, that is robust to noise, bias and erasure (incompleteness) over ranging data.