arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.10176cs.CRcs.AI
收藏

当提示成为载荷:一种缓解大型语言模型驱动应用中SQL注入攻击的框架

When Prompts Become Payloads: A Framework for Mitigating SQL Injection Attacks in Large Language Model-Driven Applications

Hasso Plattner Institute, University of Potsdam, Germany(波茨坦大学霍斯曼-普拉特研究所, 德国);Chemnitz University of Technology, Chemnitz, Germany(Chemnitz技术大学, Chemnitz, 德国)

Farzad Nourmohammadzadeh Motlagh, Mehrdad Hajizadeh, Mehryar Majd, Pejman Najafi, Feng Cheng, Christoph Meinel

AI总结:

本文提出一种多层安全框架,通过提示清洗、威胁检测和签名控制层缓解LLM介导的SQL注入攻击,实验表明其在检测精度和误报率方面表现优异。

摘要:

自然语言接口与结构化数据库的连接正变得越来越普遍,主要归功于大型语言模型(LLMs)的进步,使用户能够通过对话输入查询数据,而不是使用SQL等正式查询语言。尽管这种范式显著提高了可用性和可访问性,但它引入了新的安全风险,特别是通过提示到SQL的翻译过程放大SQL注入漏洞。恶意用户可以利用这些机制通过设计对抗性提示操纵模型行为并生成不安全的查询。本文提出了一种多层安全框架,旨在检测和缓解LLM介导的SQL注入攻击。该框架集成了前端安全盾牌用于提示清洗,先进的威胁检测模型用于行为和语义异常识别,以及基于签名的控制层用于已知攻击模式。我们评估了所提出的框架在多样且现实的攻击场景下的性能,包括提示注入、混淆的SQL载荷和上下文操纵攻击。为确保鲁棒性,我们生成并整理了一个全面的对抗性提示基准数据集,并在微调LLM配置下评估性能。实验结果表明,所提出的方法在高检测精度的同时保持低误报率,显著提高了LLM驱动数据库应用的安全部署。

英文摘要:

Natural language interfaces to structured databases are becoming increasingly common, largely due to advances in large language models (LLMs) that enable users to query data using conversational input rather than formal query languages such as SQL. While this paradigm significantly improves usability and accessibility, it introduces new security risks, particularly the amplification of SQL injection vulnerabilities through the prompt-to-SQL translation process. Malicious users can exploit these mechanisms by crafting adversarial prompts that manipulate model behavior and generate unsafe queries. In this work, we propose a multi-layered security framework designed to detect and mitigate LLM-mediated SQL injection attacks. The framework integrates a front-end security shield for prompt sanitization, an advanced threat detection model for behavioral and semantic anomaly identification, and a signature-based control layer for known attack patterns. We evaluate the proposed framework under diverse and realistic attack scenarios, including prompt injection, obfuscated SQL payloads, and context-manipulation attacks. To ensure robustness, we generate and curate a comprehensive benchmark dataset of adversarial prompts and assess performance across a fine-tuned LLM configuration. Experimental results demonstrate that the proposed approach achieves high detection accuracy while maintaining low false-positive rates, significantly improving the secure deployment of LLM-powered database applications.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑