A systematic survey of LLM-based text-to-SQL: methodologies, security vulnerabilities, and future challenges

Background Text-to-Structured Query Language (SQL) systems, which allow users to query databases using natural language, have advanced significantly with the rise of Large Language Models (LLMs). While this progress has boosted accuracy, it has also introduced serious security and practical deployment challenges that existing literature has not systematically analyzed. Methodology In this article, we systematically review the existing literature to examine various approaches, identify security vulnerabilities, discuss design trade-offs, and outline future challenges. Our goal is to offer a comprehensive overview. Results Our analysis shows that modern approaches fall into two main categories: prompt engineering on proprietary models and fine-tuning open-source models. Regarding security, using the Open Worldwide Application Security Project (OWASP) Top 10 framework, we identify critical threats such as Prompt Injection (P2SQL), data poisoning to create backdoors, and inference attacks. The analysis reveals that current defense mechanisms are not effective enough against these attacks. We also highlight the strategic trade-off between the superior accuracy of proprietary models and the control, security, and cost-effectiveness of open-source models. Conclusion This survey provides a systematic analysis of security vulnerabilities in LLM-based Text-to-SQL systems, concluding that current countermeasures are inadequate. Our findings point to an urgent research direction: developing systems that are not only accurate but also robust, efficient, and fundamentally secure for reliable real-world deployment.

Authors

Institutions

Publication Details

Journal
PeerJ Computer Science
Published
2026-04-17
DOI
https://doi.org/10.7717/peerj-cs.3773
Primary Topic
Web Application Security Vulnerabilities
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A systematic survey of LLM-based text-to-SQL: methodologies, security vulnerabilities, and future challenges

Tao Quoc Ngo, Hoang Ha Nguyen, Chien Dinh Bui, Son Tung Ngo et al.
PeerJ Computer Science
Web Application Security Vulnerabilities
article

A systematic survey of LLM-based text-to-SQL: methodologies, security vulnerabilities, and future challenges

Tao Quoc Ngo, Hoang Ha Nguyen, Chien Dinh Bui, Son Tung Ngo, Chien Hong Nguyen, Duc Van Nguyen, Huyen Khanh Vu-Thi
article en

Abstract

Background Text-to-Structured Query Language (SQL) systems, which allow users to query databases using natural language, have advanced significantly with the rise of Large Language Models (LLMs). While this progress has boosted accuracy, it has also introduced serious security and practical deployment challenges that existing literature has not systematically analyzed. Methodology In this article, we systematically review the existing literature to examine various approaches, identify security vulnerabilities, discuss design trade-offs, and outline future challenges. Our goal is to offer a comprehensive overview. Results Our analysis shows that modern approaches fall into two main categories: prompt engineering on proprietary models and fine-tuning open-source models. Regarding security, using the Open Worldwide Application Security Project (OWASP) Top 10 framework, we identify critical threats such as Prompt Injection (P2SQL), data poisoning to create backdoors, and inference attacks. The analysis reveals that current defense mechanisms are not effective enough against these attacks. We also highlight the strategic trade-off between the superior accuracy of proprietary models and the control, security, and cost-effectiveness of open-source models. Conclusion This survey provides a systematic analysis of security vulnerabilities in LLM-based Text-to-SQL systems, concluding that current countermeasures are inadequate. Our findings point to an urgent research direction: developing systems that are not only accurate but also robust, efficient, and fundamentally secure for reliable real-world deployment.

PeerJ Computer ScienceVol. 12
FPT University (VN), Vietnam Academy of Science and Technology (VN), Hanoi University of Science and Technology (VN)
Partnerships for the goals
Openalex Percentile: Top 16%
Web Application Security Vulnerabilities
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A systematic survey of LLM-based text-to-SQL: methodologies, security vulnerabilities, and future challenges — Tao Quoc Ngo, Hoang Ha Nguyen, et al. · PeerJ Computer Science (2026) | TGRS Research Map | TGRS