<div class="page" title="Page 1"><div class="layoutArea"><div class="column"><p>The rapid advancements in automotive technology and the emergence of next-generation networks such as 5G and 6G are laying the foundation for the internet of vehicles (IoV), a revolutionary concept to transform transportation systems. The convergence of artificial intelligence (AI) and connected vehicles IoV is driving a paradigm shift in the transportation sector, especially in the dynamic framework of 5G and future 6G networks. This survey paper provides a thorough survey of the evolving AI-based IoV security landscape. We explore key areas of 5G/6G networks, focusing on the complex interplay of machine learning (ML) and deep learning (DL) in enhancing vehicle-to-everything (V2X) security and connected vehicles. Addressing the unique challenges of 6G, this paper outlines future directions for improving security and highlights open research issues. This comprehensive survey, which aims to provide information and guidance to both researchers and practitioners, contributes to a detailed understanding of the security issues associated with connected vehicles in the emerging 6G era.</p></div></div></div>