Anomaly detection in wireless sensor networks is an important challenge for tasks such as fault diagnosis, intrusion detection, and monitoring applications. The algorithms developed for anomaly detection have to consider the inherent limitations of sensor networks in their design so that the energy consumption in sensor nodes is minimized and the lifetime of the network is maximized. In this survey article we analyze the state of the art in anomaly detection techniques for wireless sensor networks and discuss some open issues for research.