Skip to content
EventPast event

Study reveals contextual injection attack surface in code comments

1 reports1 reporting sourcesLatest report

Start here

AI overview

A paper published on October 4, 2026 proposed a context injection attack surface in code comments, testing whether embedding unsafe instructions in the development context can induce Code LLMs to generate vulnerable code. On ten 3B–13B open-source Code LLMs (four base, six instruction-tuned) and ten categories of web application weaknesses, under the attack condition 77.4%–92.3% of completions contained medium or higher weaknesses, versus only 1.7%–5.1% under the benign condition. The average vulnerable output rates of base and instruction-tuned models were 86.5% and 84.5%, respectively, with a reduction of at most 8.1% after instruction tuning, and susceptibility showed no clear association with model scale or specialization.

Generated by AI from reports · Updated 2026-10-22

Related research

This event's paper

Progress timeline

Oct 4
  1. Paper Tracker
    Research reveals context injection attack surface in code comments: ten Code LLMs hit rates of 77.4%–92.3%

    The researchers propose a context injection attack surface in code comments and test whether unsafe instructions embedded in the development context can induce Code LLMs to generate vulnerable code. Across ten open-source Code LLMs ranging from 3B to 13B (four base models and six instruction-tuned models) and ten categories of web application weaknesses, 77.4%–92.3% of completions under attack conditions contained medium or higher weaknesses, while benign conditions yielded only 1.7%–5.1%. The average vulnerable output rates for base and instruction-tuned models were 86.5% and 84.5%, respectively, with instruction tuning reducing the rate by at most 8.1%, and susceptibility showed no clear correlation with model size or specialization direction. Among vulnerable outputs, 86.2%–91.0% were rated high or critical severity, and the effect persisted after removing pattern-based detectors. Post-generation screening reduced but did not eliminate the risk, with even the strongest screening missing about one-third.