CommentInject: A benchmark of adversarial code-comment injection against LLM vulnerability detectors
30 vulnerable Python functions across 14 CWE categories, 12 adversarial comment strategies in four families (verification premise, context manipulation, credibility vocabulary, pressure and distraction), and 3,360 recorded trials from four studies run locally through Ollama at temperature 0: an attack ranking (780 trials), a comment-stripping defense (1,020), a cross-model comparison (600) and a transferability study (960), on qwen2.5-coder 7B, deepseek-coder 6.7B, codellama 7B and codegemma 7B. Includes the original harnesses and an analysis script that reproduces every headline number with Wilson 95% confidence intervals. Related work (added in v1.1.0). Moon et al. (arXiv 2505.16222, "Don't Judge Code by Its Cover") show that LLM judges of code correctness are biased by superficial variations such as comments and variable names. Alves and Henriques (SBSeg 2026, Workshop de Cibersegurança em IA, DOI 10.5753/sbseg estendido.2026.33836) test four LLMs on smart contract vulnerability detection with comments removed or identifiers renamed and report that semantically equivalent code can lead to different diagnoses. Heibel and Lowd (arXiv 2407.11072, "MaPPing Your Model") show that a small amount of added prompt text can make a programming assistant insert vulnerabilities. That is the code generation side, while CommentInject targets the review side, where the attacker controls the comments. Cihan, İçöz, Haratian and Tüzün (arXiv 2505.20206) evaluate GPT-4o and Gemini 2.0 Flash as code reviewers and report that their outputs can be faulty. Thornton (arXiv 2602.16741) tests eight models, mostly commercial, over 9,366 trials and reports small, non-significant effects of adversarial comments on detection, and that stripping comments lowers detection for weaker models. CommentInject uses four open models of about 7B parameters, so its results should not be read as holding for commercial models. v1.1.0 changes this description only. Data, harnesses and results are unchanged.
- Link
- https://doi.org/10.5281/zenodo.23680782
- Found by
- DataCite
- Authors
- Sunny Chokshi
- Organizations
- University of the Cumberlands
- Categories
- benchmark, evaluation
- Published
- 2026-10-27
- Last seen by the radar
- 2026-10-28
- Citations
- 0
- Downloads
- 0
- Views
- 0
- Radar score
- 41.93 / 100 (how it is scored)
- Why it scored so
- Matched: benchmark, evaluat; Primary record: DataCite
- Related links
- https://zenodo.org/doi/10.5281/zenodo.23680782