Self-driving vehicles are very susceptible to cyber attacks. This paper aims to utilize a machine learning approach in combating cyber attacks on self-driving vehicles. We focus on detecting incorrect data that are injected into the data bus of vehicles. We will utilize the extreme gradient boosting approach, as a promising example of machine learning, to classify such incorrect information. We will discuss in details the research methodology, which includes acquiring the driving data, pre-processing it, artificially inserting incorrect information, and finally classifying it. Our results show that the considered algorithm achieve accuracy of up to 92% in detecting the abnormal behavior on the car data bus.