arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2406.14545cs.CL
收藏

揭开数据库漏洞:文本到SQL系统中的零知识模式推断攻击

Unmasking Database Vulnerabilities: Zero-Knowledge Schema Inference Attacks in Text-to-SQL Systems

Department of Information Systems and Cyber Security(信息系统与网络安全系);The University of Texas at San Antonio(德克萨斯大学圣安东尼奥分校)

Đorđe Klisura, Anthony Rios

AI总结:

本文提出一种零知识模式推断攻击框架,通过精心设计的问题探测文本到SQL模型并利用GPT-4解释输出,以高准确率重建数据库表名等模式信息,揭示了严重的安全漏洞并评估了简单防护机制的局限。

摘要:

文本到SQL系统使用户能够使用自然语言与数据库交互,自动将查询翻译为可执行的SQL代码。然而,它们在SQL生成中对数据库模式信息的依赖使其面临重大安全漏洞,尤其是可能导致未授权数据访问或操纵的模式推断攻击。在本文中,我们提出了一种新颖的零知识框架,用于在没有任何数据库先验知识的情况下重建文本到SQL模型的底层数据库模式。我们的方法通过专门设计的问题系统地探测文本到SQL模型,并利用代理GPT-4模型来解释输出,从而有效揭示隐藏的模式元素——包括表、列和数据类型。我们证明,我们的方法在重建表名方面达到了高准确率,生成式模型的F1分数最高可达0.99,微调模型为0.78,这凸显了模式泄露风险的严重性。我们还表明,我们的攻击可以窃取非文本到SQL模型中的提示信息。此外,我们为生成式模型提出了一种简单的保护机制,并通过实验证明其在缓解这些攻击方面的局限性。

英文摘要:

Text-to-SQL systems empower users to interact with databases using natural language, automatically translating queries into executable SQL code. However, their reliance on database schema information for SQL generation exposes them to significant security vulnerabilities, particularly schema inference attacks that can lead to unauthorized data access or manipulation. In this paper, we introduce a novel zero-knowledge framework for reconstructing the underlying database schema of text-to-SQL models without any prior knowledge of the database. Our approach systematically probes text-to-SQL models with specially crafted questions and leverages a surrogate GPT-4 model to interpret the outputs, effectively uncovering hidden schema elements -- including tables, columns, and data types. We demonstrate that our method achieves high accuracy in reconstructing table names, with F1 scores of up to .99 for generative models and .78 for fine-tuned models, underscoring the severity of schema leakage risks. We also show that our attack can steal prompt information in non-text-to-SQL models. Furthermore, we propose a simple protection mechanism for generative models and empirically show its limitations in mitigating these attacks.

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

↑