Skip to main content
LLM Security Database
Skip to research details
Back to research findings
LMVD-ID: 8ee72e81
Paper published November 1, 2024
Entry analyzed December 28, 2024
Paper-reported evidence
Confidence: Source-linked

The LMVD-ID is an internal research identifier, not an official CVE identifier.

SQL Injection Jailbreak

A novel SQL Injection Jailbreak (SIJ) vulnerability allows attackers to bypass safety mechanisms in Large Language Models (LLMs) by manipulating the structure of input prompts. The attack leverages the model's…

BibTeX citation

Paper-evaluated models(5)

DeepSeek LLM 7B Chat, Llama 2 7B Chat, Llama 3.1 8B Instruct +2 more
  • DeepSeek LLM 7B Chat
  • Llama 2 7B Chat
  • Llama 3.1 8B Instruct
  • Mistral 7B Instruct v0.2
  • Vicuna 7B v1.5

Description

A novel SQL Injection Jailbreak (SIJ) vulnerability allows attackers to bypass safety mechanisms in Large Language Models (LLMs) by manipulating the structure of input prompts. The attack leverages the model's processing of system prompts, user prefixes, user prompts, and assistant prefixes to effectively "comment out" the expected response prefix and inject harmful instructions, causing the LLM to generate unsafe content. This vulnerability exploits the external properties of the LLM, specifically how it parses input prompts, rather than inherent model weaknesses.

Examples

See the paper's repository https://github.com/weiyezhimeng/SQLInjection-Jailbreak (opens in a new tab) for detailed examples and attack prompts. The paper demonstrates successful attacks across multiple open-source LLMs.

Impact

Successful exploitation of this vulnerability allows attackers to elicit harmful and unsafe content from LLMs, potentially leading to the generation of harmful instructions, biased outputs, personal information disclosure, or other malicious activities. The attack achieves near 100% success rates in the described experiments.

Affected Systems

Open-source LLMs including Vicuna-7b-v1.5, Llama-2-7b-chat-hf, Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.2, and DeepSeek-LLM-7B-Chat. The vulnerability potentially affects other LLMs with similar prompt parsing mechanisms.

Mitigation Steps

  • Implement input sanitization and validation techniques to prevent malicious prompt structures.
  • Develop robust parsing mechanisms that are less susceptible to manipulation through structural changes in the input.
  • Employ defense methods that incorporate random strings or keys after ethical prompts, making it harder for attackers to reliably predict response prefixes. (as suggested by the Self-Reminder-Key in the paper)
  • Regularly update and patch LLMs with security fixes addressing newly discovered vulnerabilities.
  • Conduct thorough security testing and penetration testing of LLMs to identify and mitigate potential vulnerabilities.

Research context and confidence

Evidence and verification
Paper-reported; independent reproduction is not documented.
Primary research source linked.
Severity
Not rated by this catalog.
Source and publication type
arXiv · Research preprint.
Peer-review status is not provided by this source.
Author and publication status
Author metadata is not stored; see the primary paper.
Threat model and attacker access
Black-box model, service, or application access.
Related deployment categories
No related deployment category is classified.
Taxonomy labels only; paper-specific deployment prerequisites are not inferred.
Affected systems
Open-source LLMs including Vicuna-7b-v1.5, Llama-2-7b-chat-hf, Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.2, and DeepSeek-LLM-7B-Chat. The vulnerability potentially affects other LLMs with similar prompt parsing…

Research Paper

SQL Injection Jailbreak: a structural disaster of large language models

Primary source: arXiv. Findings are reported by the cited research and have not been independently verified.

View Paper

Evidence

This entry is based on a primary research source. Its findings are paper-reported; independent reproduction and verification are not claimed.

https://arxiv.org/abs/2411.01565