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.
Track-SQL: Enhancing Generative Language Models with Dual-Extractive Modules for Schema and Context Tracking in Multi-turn Text-to-SQL
School of Computer Science, Guangdong University of Technology(广东技术大学计算机科学学院);Guangdong Laboratory of Artificial Intelligence and Digital Economy (SZ)(广东人工智能与数字经济实验室);Peng Cheng Laboratory(鹏城实验室);College of Science, Shantou University(汕头大学理学院)
S$^2$SQL: Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parsers
Alibaba Group(阿里巴巴集团);University of Chinese Academy of Sciences(中国科学院大学);The Chinese University of Hong Kong(香港中文大学);Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院)
IGSQL: Database Schema Interaction Graph Based Neural Model for Context-Dependent Text-to-SQL Generation
Wangxuan Institute of Computer Technology, Peking University(北京大学王选计算机研究所);Center for Data Science, Peking University(北京大学数据科学中心);The MOE Key Laboratory of Computational Linguistics, Peking University(北京大学教育部计算语言学重点实验室)
LinkAlign: Scalable Schema Linking for Real-World Large-Scale Multi-Database Text-to-SQL
China Academy of Information and Communications Technology(中国信息通信技术研究院);Renmin University of China(中国人民大学);University of International Business and Economics(国际经济贸易大学)
SADGA: Structure-Aware Dual Graph Aggregation Network for Text-to-SQL
School of Computer Science, Guangdong University of Technology(广东工业大学计算机学院);Peng Cheng Laboratory(鹏城实验室);College of Science, Shantou University(汕头大学理学院)
STAR: SQL Guided Pre-Training for Context-dependent Text-to-SQL Parsing
University of Science and Technology of China(中国科学技术大学);Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);DAMO Academy, Alibaba Group(阿里巴巴集团达摩院)
Proton: Probing Schema Linking Information from Pre-trained Language Models for Text-to-SQL Parsing
University of Chinese Academy of Sciences(中国科学院大学);Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);Alibaba Group(阿里巴巴集团);Massachusetts Institute of Technology(麻省理工学院)
Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
School of Computer Science, Northwestern Polytechnical University(西北工业大学计算机学院);Big Data Shortage and Management, MIIT(工业和信息化部大数据短缺与管理局);School of Computing, National University of Singapore(新加坡国立大学计算机学院);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算与信息系统学院)
EviLink: Multi-Path Schema Linking with Uncertainty-Guided Evidence Acquisition for Large-Scale Text-to-SQL
School of Software Technology, Zhejiang University(浙江大学软件学院);State Key Lab of CAD&CG, Zhejiang University(浙江大学CAD&CG国家重点实验室);Tencent TEG(腾讯TEG);School of Mathematical Sciences, Peking University(北京大学数学科学学院)
Towards Robustness of Text-to-SQL Models against Synonym Substitution
Queen Mary University of London(伦敦玛丽女王大学);UC Berkeley(加州大学伯克利分校);Jožef Stefan Institute(约瑟夫·斯特凡研究所);Nanning Central Sub-branch of the People’s Bank of China(中国人民银行南宁中心支行);Guangxi University of Finance and Economics(广西财经学院);Beijing MeiyiLab Co.,Ltd.(北京美仪实验室有限公司)
Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
Queen Mary University of London(伦敦玛丽女王大学);UC Berkeley(加州大学伯克利分校);Jožef Stefan Institute(约瑟夫·斯蒂芬研究所);Guangxi University of Finance and Economics(广西财经大学);University of Leicester(莱斯特大学)
DCG-SQL: Enhancing In-Context Learning for Text-to-SQL with Deep Contextual Schema Link Graph
Department of Artificial Intelligence, Sungkyunkwan University(人工智能系,成均馆大学);Department of Immersive Media Engineering, Sungkyunkwan University(沉浸媒体工程系,成均馆大学);Department of Computer Science and Engineering, Sungkyunkwan University(计算机科学与工程系,成均馆大学)
ProSPy: A Profiling-Driven SQL-Python Agentic Framework for Enterprise Text-to-SQL
State Key Lab of CAD&CG(计算机辅助设计与图形学国家重点实验室);School of Software Technology(软件技术学院);Tencent TEG(腾讯科技集团);School of Mathematical Sciences, Peking University(北京大学数学科学学院);Zhejiang University(浙江大学)