Although the reception of Internet of Things (IoT) services increased efficiency and allowed companies to automate the production through remote and intelligent control, it also increases the risk of potential threats and security attacks. The attackers can compromise the security of the IoT node and join it to a botnet, manipulate sensitive data or take control of a full network. Securing the IoT nodes from security attacks remains a challenge, especially under the multiple attack models where several attacks can be launched simultaneously. The objective of this paper is to prevent a type of multiple attacks that are the foundation to manipulate sensor nodes’ data that are: clone attack, tamper attack, false data injection, node malfunctioning, and physical layer attack. A solution is proposed to secure the IoT nodes against these attacks. The proposed solution is based on a novel sensor pairing approach to evaluate the trustworthiness of IoT nodes’ sensor data using multiple machine learning models. In particular, we propose a threat model and the pairing algorithm to pair each sensor node with the sensor node located in the neighbor. We compare the performance of three machine learning models, which are decision tree, Support Vector Machine (SVM), and k-Nearest Neighbors (KNN) by using two publically available real-world datasets in terms of attack detection accuracy, training time, and testing time. Our proposed system achieved up to 100% accuracy rate and nearly twice faster training and testing time as compared to the existing solutions. We provide the memory and energy consumption analysis to show that the proposed method has lower communication and memory overhead on IoT nodes than previous solutions against IoT security attacks. Our dataset just contains the data of a pair of sensors and is reduced up to eight times smaller in size than the actual dataset.