信息网络安全 ›› 2026, Vol. 26 ›› Issue (1): 150-167.doi: 10.3969/j.issn.1671-1122.2026.01.013

• 学术研究 • 上一篇    下一篇

融合GAT与可解释DQN的SQL注入攻击检测模型

邓钰洋1, 芦天亮1(), 李知皓1, 孟昊阳1, 马远声2   

  1. 1.中国人民公安大学信息网络安全学院,北京 100038
    2.北京市公安局网络安全保卫总队,北京 102611
  • 收稿日期:2025-08-25 出版日期:2026-01-10 发布日期:2026-02-13
  • 通讯作者: 芦天亮 lutianliang@ppsuc.edu.cn
  • 作者简介:邓钰洋(2003—),男,北京,硕士研究生,CCF会员,主要研究方向为网络安全|芦天亮(1985—),男,北京,教授,博士,主要研究方向为网络安全|李知皓(2003—),男,浙江,硕士研究生,主要研究方向为数据警务|孟昊阳(2003—),男,河北,硕士研究生,主要研究方向为网络安全|马远声(1988—),男,北京,本科,主要研究方向为电子数据取证

A SQL Injection Attack Detection Model Integrating GAT and Interpretable DQN

DENG Yuyang1, LU Tianliang1(), LI Zhihao1, MENG Haoyang1, MA Yuansheng2   

  1. 1. School of Information Network Security, People’s Public Security University of China, Beijing 100038, China
    2. Cyber Security Corps of the Beijing Municipal Public Security Bureau, Beijing 102611, China
  • Received:2025-08-25 Online:2026-01-10 Published:2026-02-13

摘要:

随着Web应用的持续演进及数据库驱动系统的广泛部署,SQL注入攻击作为一种高度隐蔽且破坏力强的网络攻击方式,依然是当前Web安全防护的重要研究对象。针对SQL注入语句结构复杂、语义多样以及攻击样本稀缺等问题,文章提出一种融合图结构建模与强化学习机制的SQL注入攻击检测方法。该方法将SQL语句建模为图结构,通过改进的图注意力网络GAT融合节点与边的语法特征,并构建了包含4个专门化检测专家的多智能体强化学习框架,实现动态集成决策。同时,该检测方法设计了针对SQL注入攻击混淆特点的对抗样本生成模块,增强了模型对复杂变形攻击的识别能力。此外,结合LIME与SHAP方法对检测结果进行可解释性分析,增强系统的透明度与实用性。实验结果表明,该方法在保持较低计算资源消耗的前提下,有效缓解了样本不均衡与攻击模式多样化引起的检测偏差问题。该方法在综合性SQL注入数据集上的检测准确率达0.955,AUC值为0.978,显著优于现有基线方法,为SQL注入攻击的智能化检测提供了有效解决方案。

关键词: SQL注入攻击检测, 图注意力网络, 多智能体, DQN, 可解释强化学习

Abstract:

With the continuous evolution of web applications and widespread deployment of database-driven systems, SQL injection attacks remain a critical research focus in web security defense due to their highly covert and destructive nature. To address challenges posed by structural complexity, semantic diversity, and scarcity of attack samples in SQL injection attack statements, this paper proposed a novel detection method integrating graph structure modeling with reinforcement learning mechanisms. The proposed approach models SQL statements as graph structures and leverages an enhanced Graph Attention Network (GAT) to fuse syntactic features from nodes and edges. A multi-agent reinforcement learning framework incorporating four specialized detection experts was constructed to enable dynamic ensemble decision-making. Additionally, an adversarial sample generation module specifically designed for SQL injection obfuscation characteristics enhanced the model’s capability in identifying complex mutation attacks. Furthermore, explainability analysis using LIME and SHAP methods improved system transparency and practical applicability. Experimental results demonstrate that the proposed method effectively mitigates detection bias caused by sample imbalance and attack pattern diversification while maintaining low computational resource consumption. The method achieves 0.955 detection accuracy and 0.978 AUC on comprehensive SQL injection datasets, significantly outperforming existing baseline methods and providing an effective solution for intelligent SQL injection attack detection.

Key words: SQL injection detection, graph attention network, multi-agent, DQN, interpretable reinforcement learning

中图分类号: