In this paper we deal with spoofing detection in GNSS receivers. We derive the optimal genie detector when the true positions are perfectly known, and the observation errors are Gaussian, as a benchmark for other detectors. The system model considers three dimensional positions, and includes correlated errors. In addition, we propose several detectors that do not need any position knowledge, that outperform recently proposed detectors in many interesting cases.