Skip to main content
LLM Security Database
Skip to research details
Back to research findings
LMVD-ID: c44c4e65
Paper published March 1, 2025
Entry analyzed April 3, 2025
Paper-reported evidence
Confidence: Source-linked

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

Implicit Prompt Code Jailbreak

Large Language Models (LLMs) used for code generation are vulnerable to a jailbreaking attack that leverages implicit malicious prompts. The attack exploits the fact that existing safety mechanisms primarily rely on…

BibTeX citation

Paper-evaluated models(6)

Claude 3.5 Sonnet, Code Llama 13B Instruct, DeepSeek Coder 7B +3 more
  • Claude 3.5 Sonnet
  • Code Llama 13B Instruct
  • DeepSeek Coder 7B
  • DeepSeek V3
  • GPT-4
  • Qwen Plus

Description

Large Language Models (LLMs) used for code generation are vulnerable to a jailbreaking attack that leverages implicit malicious prompts. The attack exploits the fact that existing safety mechanisms primarily rely on explicit malicious intent within the prompt instructions. By embedding malicious intent implicitly within a benign-appearing commit message accompanying a code request (e.g., in a simulated software evolution scenario), the attacker can bypass the LLM's safety filters and induce the generation of malicious code. The malicious intent is not directly stated in the instruction, but rather hinted at in the context of the commit message and the code snippet.

Examples

See the research paper "Smoke and Mirrors: Jailbreaking LLM-based Code Generation via Implicit Malicious Prompts" for specific examples. The paper includes examples demonstrating the creation of implicit malicious prompts for text-to-code, function-level completion, and block-level completion tasks.

Impact

Successful exploitation allows attackers to generate malicious code, such as malware or code for denial-of-service attacks, bypassing the LLM's built-in safety features. The generated code may then be used to compromise systems or data. The attack's success rate is significantly higher than techniques relying solely on explicitly malicious prompts.

Affected Systems

LLM-based code generation systems using models susceptible to this implicit prompt injection technique. The paper evaluates DeepSeek-V3, GPT-4, Claude-3.5-Sonnet, Gemini-2.0, Qwen-Plus, CodeLlama-13B-Instruct, and DeepSeek-Coder-7B.

Mitigation Steps

  • Implement more robust safety mechanisms that analyze not only explicit instructions but also the complete context of the prompt, including any attached information like commit messages.
  • Develop techniques to detect and mitigate implicit cues indicating malicious intent.
  • Adopt a layered security approach with multiple independent safety checks.
  • Regularly update and improve the models' safety training data to include examples of implicit malicious prompts.
  • Carefully review and validate all generated code for malicious behavior before deploying it.

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
LLM-based code generation systems using models susceptible to this implicit prompt injection technique. The paper evaluates DeepSeek-V3, GPT-4, Claude-3.5-Sonnet, Gemini-2.0, Qwen-Plus, CodeLlama-13B-Instruct, and…

Research Paper

Smoke and Mirrors: Jailbreaking LLM-based Code Generation via Implicit Malicious Prompts

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/2503.17953