This study presents a comprehensive exploration of machine learning (ML) techniques for predicting vulnerabilities in websites, which is a critical aspect of modern cybersecurity. With the advancement of digital threats and the complexity of cyber-attacks, conventional security strategies have become increasingly inadequate. By employing machine learning algorithms such as Random Forest and Gradient Boosting, this study formulates models adept at identifying potential vulnerabilities within the website code. This approach responds to the escalating demand for enhanced security measures, in the face of increasingly sophisticated digital threats. By integrating anomaly detection findings through the Isolation Forest algorithm, this study enriches the training dataset, enabling models to adapt to both known and emerging vulnerability patterns
The Gradient Boosting model slightly outperformed the Random Forest model in terms of overall accuracy, achieving a precision of 97% for the non-vulnerability class, and the vulnerability class had a precision of 90%, leading to an overall accuracy of 96.25%., which is attributed to its ability to iteratively learn from previous errors, thereby enhancing its adaptability to new vulnerabilities. This study underscores the significant potential of ML to enhance cybersecurity measures against website vulnerabilities.