[Paper] Context-Based Adversarial Attacks on AI Code Generators: Vulnerability Analysis and Implications

Published: (June 9, 2026 at 10:51 AM EDT)
1 min read
Source: arXiv

Source: arXiv - 2606.10945v1

Overview

AI-powered code generation systems have transformed software development but introduce critical inference-time security vulnerabilities. This research presents a systematic investigation of context-based adversarial attacks, where strategically crafted contextual inputs, including comments, documentation, variable names, bias large language models toward generating exploitable code. Through 2,800 controlled experiments across CodeT5+, CodeLlama, GPT-3.5-Turbo, and GPT-4, we quantify attack effectiveness and defense mechanisms. Results demonstrate that adversarial conditions increase vulnerability generation 10.7x (from 3.5% to 37.4%), with direct instruction attacks achieving 100% success on GPT-3.5-Turbo. Cross-model transferability reaches 60-100%, indicating systemic architectural vulnerabilities rather than model-specific flaws. Our dual-layer defense framework achieves 89.1% detection rate with 0.3% false positives and 520ms latency, demonstrating practical feasibility for real-time deployment in development environments.

Key Contributions

This paper presents research in the following areas:

  • cs.CR
  • cs.SE

Methodology

Please refer to the full paper for detailed methodology.

Practical Implications

This research contributes to the advancement of cs.CR.

Authors

  • Walther A. Del Orbe
  • John D. Hastings
  • Varghese Vaidyan

Paper Information

  • arXiv ID: 2606.10945v1
  • Categories: cs.CR, cs.SE
  • Published: June 9, 2026
  • PDF: Download PDF
0 views
Back to Blog

Related posts

Read more »