The core of the smart grid relies on the ability of transmitting realtime metering data and control commands efficiently and reliably. Secure in-network data aggregation approaches have been introduced to fulfill the goal in smart grid neighborhood area networks (NANs) by aggregating the data on-the-fly via intermediate meters. To protect users’ privacy from being learnt from the fine-grained consumption data by the utilities or other third-party services, homomorphic encryption schemes have been adopted. Hence, intermediate smart meters participate in the aggregation without seeing any individual reading, nor intermediate or final aggregation results. However, the malleable property of homomorphic encryption operations makes it difficult to identify misbehaving meters from which false data can be injected through accidental errors or malicious attacks. In this paper, we propose an efficient anomaly detection scheme based on dynamic grouping and data re-encryption, which is compatible with existing secure in-network aggregation schemes, to detect falsified data injected by malfunctioning and malicious meters.