Abstract-In recent years, the security issues of the cognitive radio (CR) networks have drawn a lot of research attentions. Primary user emulation attack (PUEA), as one of common attacks, compromises the spectrum sensing, where a malicious user forestalls vacant channels by impersonating the primary user to prevent other secondary users from accessing the idle frequency bands. In this paper, we propose a new cooperative spectrum sensing scheme, considering the existence of PUEA in CR networks. In the proposed scheme, the sensing information of different secondary users is combined at a fusion center and the combining weights are optimized with the objective of maximizing the detection probability of available channels under the constraint of a required false alarm probability. We also investigate the impact of the channel estimation errors on the detection probability. Simulation and numerical results illustrate the effectiveness of the proposed scheme in cooperative spectrum sensing in the presence of PUEA.Index Terms-Cognitive radio, cooperative spectrum sensing, primary user emulation attack, security, optimization.