Accurate localization is a critical enabling technology for sensor networks and context awareness in the Internet of Things. As localization plays an increasingly safety-critical role in applications, engineers must have confidence in the validity of location data. In this paper we consider the sensor network localization problem with noisy distance measurements and propose a method to detect adversarially corrupted values. Our algorithm,Gordian SMT, rapidly finds attacks on distance measurements by identifying geometric inconsistencies at the graph level without requiring assumptions about hardware, ranging mechanisms or cryptographic protocols. We give the necessary and sufficient conditions for which attack detection is guaranteed to be possible in the noiseless case, and present Gordian SMT as a sound and complete algorithm for well-posed noiseless input. We extend Gordian SMT to the case of noisy measurements where our empirical analysis shows good performance at a run-time several orders of magnitude faster than the naive brute force algorithm.