DaMiT-SQL: Detecting and Mitigating Text-to-SQL Prompt Injection Attacks

Zi Han Ding and Alexandros Labrinidis
2025 IEEE International Conference on Collaborative Advances in Software and COmputiNg (CASCON) , pp. 641–646 , 2025

Abstract

Large Language Models (LLMs) are known for their ability to understand and respond to human instructions and prompts. As such, LLMs can be used to produce natural language interfaces for databases. However, LLMs also have an attack surface that, if not properly secured, can cause serious damage. This paper explores the possibilities of exploiting LLMs as an attack surface for SQL injection. We propose a time- and cost-efficient approach to quickly detect malicious prompts by comparing the semantic similarity of the attack against a dedicated list of known patterns.