要約
Text-to-SQL システムは、クエリを実行可能な SQL コードに自動的に変換し、ユーザが自然言語を使用してデータベースと対話できるようにします。しかし、SQL生成のためのデータベーススキーマ情報への依存は、重大なセキュリティ脆弱性、特に不正なデータアクセスや操作につながるスキーマ推論攻撃にさらされる。本論文では、データベースの事前知識なしに、text-to-SQLモデルの基礎となるデータベーススキーマを再構築するための、新しいゼロ知識フレームワークを紹介する。本手法は、特別に作成された質問でtext-to-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.
arxiv情報
著者 | Đorđe Klisura,Anthony Rios |
発行日 | 2025-06-03 16:10:16+00:00 |
arxivサイト | arxiv_id(pdf) |