SQL injection detection using machine learning
Loading...
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Strathmore University
Abstract
Web applications have become prime targets for cyberattacks due to their accessibility and the sensitive information they handled. SQL injection was a prevalent attack technique that exploited vulnerabilities in input validation to execute malicious SQL queries, potentially compromising application security and integrity. Traditional SQL injection detection methods, which relied on predefined patterns and rules, struggled to adapt to the evolving tactics of attackers. The purpose of this study was to design and implement a machine learning (ML)-based SQL injection detection system utilizing convolutional neural networks (CNNs). CNNs were selected due to their proven effectiveness in identifying complex patterns and anomalies, making them suitable for detecting union-based, error-based, and blind SQL injection attacks. An analytical prototyping methodology was employed to develop and evaluate the system. The model was trained on a diverse dataset of benign and malicious SQL queries and assessed using standard performance metrics. The CNN model achieved an accuracy of 98.21%, with macro-averaged precision, recall, and F1-score all at 0.98. These results demonstrated the model’s robustness and effectiveness in distinguishing between legitimate and malicious input. The findings of this study indicated that CNN-based detection systems can significantly enhance the security of web applications by providing an adaptive and reliable defense against SQL injection attacks.
Keywords: SQL injection, Machine Learning, Convolutional Neural Networks, Anomaly Detection, Cybersecurity, Input Validation.
Description
Full - text thesis
Keywords
Citation
Muriungi, A. M. (2025). SQL injection detection using machine learning [Strathmore University]. https://hdl.handle.net/11071/16399