Cognitive radio networks (CRNs) represent a dynamic and intelligent paradigm for efficient spectrum utilization by allowing unlicensed users, known as secondary users, to opportunistically access underutilized spectrum bands. However, the open and shared nature of the spectrum in CRNs exposes them to various security threats and attacks. In this context, the need for robust intrusion detection mechanisms becomes paramount to safeguard the integrity of the network. This work proposes a novel approach for detecting attackers in cognitive radio networks using a combination of self-attention mechanism and long short-term memory (LSTM) networks. The self-attention LSTM model is designed to capture complex temporal dependencies and spatial correlations in the dynamic spectrum access patterns, making it well-suited for the inherent variability and uncertainty in CRNs. The proposed approach is evaluated using real-world CRN datasets, considering various attack scenarios such as spectrum sensing data falsification and malicious spectrum access.