PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
December 4, 2025Proceedings of the ACM on Management of Data4 citations

Are Your LLM-based Text-to-SQL Models Secure? Exploring SQL Injection via Backdoor Attacks

View Full Paper
MLMeiyu LinHZHaichuan ZhangJLJiale Lao

Key Points

  • Malicious SQL injection attacks can severely compromise database security and integrity.
  • Injecting a mere 0.44% of poisoned data led to a 79.41% success rate for backdoor attacks.
  • Assessment of LLM-based Text-to-SQL models unveils critical vulnerabilities in their architecture.
  • Strengthening defenses and implementing mitigation strategies is essential for secure SQL development.

Abstract

Large language models (LLMs) have shown state-of-the-art results in translating natural language questions into SQL queries (Text-to-SQL), a long-standing challenge within the database community. However, security concerns remain largely unexplored, particularly the threat of backdoor attacks, which can introduce malicious behaviors into models through fine-tuning with poisoned datasets. In this work, we systematically investigate the vulnerabilities of LLM-based Text-to-SQL models and present ToxicSQL, a novel backdoor attack framework. Our approach leverages stealthy command-like and character-level triggers to make backdoors difficult to detect and remove, ensuring that malicious behaviors remain covert while maintaining high model accuracy on benign inputs. Furthermore, we propose leveraging SQL injection payloads as backdoor targets, enabling the generation of malicious yet executable SQL queries, which pose severe security and privacy risks in language model-based SQL development. We demonstrate that injecting only 0.44% of poisoned data can result in an attack success rate of 79.41%, posing a significant risk to database security. Additionally, we propose detection and mitigation strategies to enhance model reliability. Our findings highlight the urgent need for security-aware Text-to-SQL development, emphasizing the importance of robust defenses against backdoor threats.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Lin et al. (2025) studied this question.

synapsesocial.com/papers/694025742d562116f28fde5chttps://doi.org/10.1145/3769762
Ask AI
Helpful
Bookmark
Share
View Full Paper

Also Consider

Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context:

  1. 1Combating misinformation in the age of LLMs: Opportunities and challenges2024 · 117 citations
  2. 2The Dawn of Natural Language to SQL: Are We Fully Ready?2024 · 72 citations
  3. 3Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task2018 · 945 citations
  4. 4Code Similarity Detection using AST and Textual Information2019 · 9 citations
  5. 5SneakyPrompt: Jailbreaking Text-to-image Generative Models2024 · 57 citations