By exploiting the communication infrastructure among the sensors, actuators, and control systems, attackers may compromise the security of smart-grid systems, with techniques such as denial-of-service (DoS) attack, random attack, and data-injection attack. In this paper, we present a mathematical model of the system to study these pitfalls and propose a robust security framework for the smart grid. Our framework adopts the Kalman filter to estimate the variables of a wide range of state processes in the model. The estimates from the Kalman filter and the system readings are then fed into the ¥ö 2 -detector or the proposed Euclidean detector. The ¥ö 2 -detector is a proven effective exploratory method used with the Kalman filter for the measurement of the relationship between dependent variables and a series of predictor variables. The ¥ö 2 -detector can detect system faults/attacks, such as DoS attack, short-term, and long-term random attacks. However, the studies show that the ¥ö 2 -detector is unabletodetectthestatisticallyderivedfalsedata-injectionattack. To overcome this limitation, we prove that the Euclidean detector can effectively detect such a sophisticated injection attack.