SQL Injection Detection Based on Lightweight Multi-Head Self-Attention
Open Access
- 9 January 2025
- journal article
- research article
- Published by MDPI AG in Applied Sciences
- Vol. 15 (2) , 571
Abstract
This paper presents a novel neural network model for the detection of Structured Query Language (SQL) injection attacks for web applications. The model features high detection accuracy, fast inference speed, and low weight size. The model is based on a novel Natural Language Processing (NLP) technique, where a tokenizer for converting SQL queries into tokens is adopted as a pre-processing stage for detection. Only SQL keywords and symbols are considered as tokens for removing noisy information from input queries. Moreover, semantic labels are assigned to tokens for highlighting malicious intentions. For the exploration of correlation among the tokens, a lightweight multi-head self-attention scheme with a position encoder is employed. Experimental results show that the proposed algorithm has high detection performance for SQL injection. In addition, compared to its lightweight NLP counterparts based on self-attention, the proposed algorithm has the lowest weight size and highest inference speed. It consumes only limited computation and storage overhead for web services. In addition, it can even be deployed in the edge devices with low computation capacity for online detection. The proposed algorithm therefore is an effective low-cost solution for SQL injection detection.Keywords
Funding Information
- National Science and Technology Council, Taiwan (MOST 111-2221-E-003-009-MY2, NSTC 113-2221-E-003-027-MY2)
This publication has 20 references indexed in Scilit:
- Deep Learning in Cybersecurity: A Hybrid BERT–LSTM Network for SQL Injection Attack DetectionIET Information Security, 2024
- Detection of SQL Injection and Cross-Site Scripting Based on Multi-Model CNN Combined with Bidirectional GRU and Multi-Head Self-Attention2023
- An Attack Detection Framework Based on BERT and Deep LearningIEEE Access, 2022
- Random Decision Forest approach for Mitigating SQL Injection Attacks2021
- SQL Injection Attack Detection and Prevention Techniques Using Deep LearningJournal of Physics: Conference Series, 2021
- Attention in Natural Language ProcessingIEEE Transactions on Neural Networks and Learning Systems, 2020
- Detection of SQL Injection Attacks Based on Improved TFIDF AlgorithmJournal of Physics: Conference Series, 2019
- CODDLE: Code-Injection Detection With Deep LearningIEEE Access, 2019
- Detecting SQL injection attacks using SNORT IDS2014
- A novel method for SQL injection attack detection based on removing SQL query attribute valuesMathematical and Computer Modelling, 2012