Abstract-Cognitive radio (CR) can improve the utilization of the spectrum by making use of licensed spectrum in an opportunistic manner. However, the security aspects of cognitive radio networks have garnered little attention. In this paper, we identify a threat to cognitive radio networks, which we call the primary user emulation (PUE) attack. To counter this threat, we proposed a new method to detect the PUE attacks which not only discuss in two kinds of situation which the primary user is stationary or mobile, but also use the Kalman filter algorithm to process the received mobile source's signal strength (RSS) value. And then, we apply with the BP neural network training and testing to complete the detection of PUE attacks. Simulations results show the goodness of the proposed method.