TrojanSQL: SQL Injection against Natural Language Interface to Database

6Citations
Citations of this article
23Readers
Mendeley users who have this article in their library.
Get full text

Abstract

The technology of text-to-SQL has significantly enhanced the efficiency of accessing and manipulating databases. However, limited research has been conducted to study its vulnerabilities emerging from malicious user interaction. By proposing TrojanSQL, a backdoor-based SQL injection framework for text-to-SQL systems, we show how state-of-the-art text-to-SQL parsers can be easily misled to produce harmful SQL statements that can invalidate user queries or compromise sensitive information about the database. The study explores two specific injection attacks, namely boolean-based injection and union-based injection, which use different types of triggers to achieve distinct goals in compromising the parser. Experimental results demonstrate that both medium-sized models based on fine-tuning and LLM-based parsers using prompting techniques are vulnerable to this type of attack, with attack success rates as high as 99% and 89%, respectively. We hope that this study will raise more concerns about the potential security risks of building natural language interfaces to databases.

Cite

CITATION STYLE

APA

Zhang, J., Zhou, Y., Hui, B., Liu, Y., Li, Z., & Hu, S. (2023). TrojanSQL: SQL Injection against Natural Language Interface to Database. In EMNLP 2023 - 2023 Conference on Empirical Methods in Natural Language Processing, Proceedings (pp. 4344–4359). Association for Computational Linguistics (ACL). https://doi.org/10.18653/v1/2023.emnlp-main.264

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free