Traditional security schemes developed for sensor networks are not suitable for cluster-based wireless sensor networks (WSNs) because of their susceptibility to Denial of Service (DoS) attacks. In this paper, we provide a security scheme against DoS attacks (SSAD) in cluster-based WSNs. The scheme establishes trust management with energy character, which leads nodes to elect trusted cluster heads. Furthermore, a new type of vice cluster head node is proposed to detect betrayed cluster heads. Theoretical analyses and simulation results show that SSAD can prevent and detect malicious nodes with high probability of success. Copyright © 2011 John Wiley & Sons, Ltd.