Recently, there are growing interests in cognitive radio vehicular ad hoc networks (CR-VANETs), which is a kind of intelligent cyber-physical systems. In CR-VANETs, there are two main processes: spectrum sensing and data transmission. Although some excellent works have been done to address spectrum sensing security and data transmission security in CR-MANETs, these two important areas have traditionally been addressed separately in the literature. In this paper, we propose to use a common framework to study trust management so as to enhance security for both spectrum sensing and data transmission processes in CR-VANETs. We identify a new attack, named joint spectrum sensing and data transmission (JSSDT) attack, in which an attacker can report fake sensing data in the spectrum sensing process as well as drop packets in the data transmission process. Then, using recent advances in the theory of uncertain reasoning, we propose a unified trust management scheme for both spectrum sensing and data transmission processes in CR-VANETs. In addition, based on the unified trust model, we present a weighted consensus-based spectrum sensing scheme to protect the spectrum sensing process. Moreover, we apply the trust value derived from the unified trust model to enhance the security of the data transmission process in CR-VANETs. Simulation results show the effectiveness of the proposed trust-based security schemes.