Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions

Anjun Gao, Yueyang Quan, Zhuqing Liu, Minghong Fang
7/9/2026
cs.CRcs.AIcs.IR

No confident code implementation found for this paper.

Abstract

Large language models have enabled powerful code completion systems that assist developers by predicting subsequent lines of code. However, these models remain vulnerable to backdoor attacks, where malicious fine-tuning data covertly implants unsafe behaviors.

Show full abstract

Despite advances in defensive techniques, adaptive and sophisticated backdoor attacks still evade detection and mitigation. We present CodeTracer, a forensic framework that traces malicious code completions back to the backdoor fine-tuning data responsible for them. Operating under realistic post-deployment constraints, CodeTracer relies solely on the fine-tuning corpus and the reported miscompletion event. It extracts a structured behavioral fingerprint from the compromised output, narrows the search to semantically relevant code samples, and employs LLM-based reasoning to attribute unsafe logic to specific backdoor data. Extensive evaluations across three representative vulnerability cases and ten backdoor attacks, along with sixteen competitive baselines, demonstrate that CodeTracer consistently achieves high forensic accuracy, low false identification rates, and strong robustness against adaptive attacks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gao2026beware,
  title  = {Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions},
  author = {Anjun Gao and Yueyang Quan and Zhuqing Liu and Minghong Fang},
  year   = {2026},
  eprint = {2607.08011},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.08011v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.08011.svg)](https://codeofpaper.com/paper/2607.08011)

Discussion