When cybersecurity is neglected, any network system loses its efficiency, reliability, and resilience. With the huge integration of the Information, Communication and Technology capabilities, the Connected Electric Vehicle (CEV) as a transportation form in cities is becoming more and more efficient and able to reply to citizen and environmental expectations which improve the quality of citizens’ life. However, this CEV technological improvement increases the CEV vulnerabilities to cyber-attacks resulting to serious risks for citizens. Thus, they can intensify their negative impact on societies and cause unexpected physical damage and economic losses. This paper targets the cybersecurity issues for CEVs in parking lots where a peer-to-peer(P2P) energy transaction system based on blockchain, and smart contract scheme is launched. A False Data Injection Attack (FDIA) on the electricity price and power signal is proposed and a Machine Learning/SVM classification protocol is used to detect and extract the right values. Simulation results are conducted to prove the effectiveness of this proposed model.