mlsanityData to 14 Oct 2026

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

arXiv 2503.17953 ↗First posted 23 Mar 2025cs.SEcited by 5

On the map: LLM safety and security → Jailbreaking

Abstract (arXiv)

The proliferation of Large Language Models (LLMs) has revolutionized natural language processing and significantly impacted code generation tasks, enhancing software development efficiency and productivity. Notably, LLMs like GPT-4 have demonstrated remarkable proficiency in text-to-code generation tasks. However, the growing reliance on LLMs for code generation necessitates a critical examination of the safety implications associated with their outputs. Existing research efforts have primarily focused on verifying the functional correctness of LLMs, overlooking their safety in code generation. This paper introduces a jailbreaking approach, CodeJailbreaker, designed to uncover safety concerns in LLM-based code generation. The basic observation is that existing safety mechanisms for LLMs are built through the instruction-following paradigm, where malicious intent is explicitly articulated within the instruction of the prompt. Consequently, CodeJailbreaker explores to construct a prompt whose instruction is benign and the malicious intent is implicitly encoded in a covert channel, i.e., the commit message, to bypass the safety mechanism. Experiments on the recently-released RMCBench benchmark demonstrate that CodeJailbreaker markedly surpasses the conventional jailbreaking strategy, which explicitly conveys malicious intents in the instructions, in terms of the attack effectiveness across three code generation tasks. This study challenges the traditional safety paradigms in LLM-based code generation, emphasizing the need for enhanced safety measures in safeguarding against implicit malicious cues.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 33 of its 53 references that are in the map. First posted on arXiv 23 Mar 2025.

Builds on

33 of 53 references.

Closest ancestors · 13

Same direction, newest first

  1. 2024RMCBench: Benchmarking Large Language Models' Resistance to Malicious Code23 Sep
  2. 2024Jailbreaking Large Language Models with Symbolic Mathematics17 Sep
  3. 2024Making Them Ask and Answer: Jailbreaking Large Language Models in Few Queries via Disguise and Reconstruction28 Feb
  4. 2024Intention Analysis Makes LLMs A Good Jailbreak Defender12 Jan
  5. 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMs12 Jan
  6. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automatically4 Dec
  7. 2023Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritization15 Nov
  8. 2023Scalable and Transferable Black-Box Jailbreaks for Language Models via Persona Modulation6 Nov
  9. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations10 Oct
  10. 2023GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Cipher12 Aug
  11. 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
  12. 2023Jailbroken: How Does LLM Safety Training Fail?5 Jul
1 more
  1. 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study23 May

Other references · 20

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2022Training language models to follow instructions with human feedbackcited by 15,971
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2020Scaling Laws for Neural Language Modelscited by 6,586
  7. 2024Qwen2.5 Technical Reportcited by 4,942
  8. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  9. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
  10. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  11. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  12. 2022Large Language Models Meet NL2Code: A Surveycited by 138
8 more
  1. 2024RedCode: Risky Code Execution and Generation Benchmark for Code Agentscited by 90
  2. 2024CodeAttack: Revealing Safety Generalization Challenges of Large Language Models via Code Completioncited by 76
  3. 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 72
  4. 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 68
  5. 2024CodeDPO: Aligning Code Models with Self Generated and Verified Source Codecited by 34
  6. 2023CCT5: A Code-Change-Oriented Pre-Trained Modelcited by 18
  7. 2024Fault Localization from the Semantic Code Search Perspectivecited by 1
  8. 2025Large Language Models-Aided Program Debloatingcited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 4.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025LLMs Caught in the Crossfire: Malware Requests and Jailbreak Challenges
  2. 2026Poster: Rethinking Security in LLM Code Generation through Real-World Risk Scenarios
  3. 2026CodeMimicry: Exploiting Safety Generalization Lag in Large Language Models via Structured Code Completion
  4. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
  5. 2025Explicit Vulnerability Generation with LLMs: An Investigation Beyond Adversarial Attacks
  6. 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
  7. 2026Enhancing Reliability in LLM-Based Secure Code Generation
  8. 2025Beyond Fixed and Dynamic Prompts: Embedded Jailbreak Templates for Advancing LLM Security