The increased application of sensor network introduces new security challenges. In this paper, we analyze the detection methods of compromised nodes and its countermeasure in the sensor network. We first review common attacks in the sensor network application which can compromise a valid, resource-constrained node (or called device). Then, we introduce several standard detection approaches to show their characteristics in different applications of the sensor network. Finally, we summarize and discuss existing countermeasures to the compromised nodes.