Transferable Backdoor Attacks for Code Models via Sharpness-Aware Adversarial Perturbation
Shuyu Chang, Haiping Huang, Yanjun Zhang, Yujin Huang, Fu Xiao, Leo Yu Zhang

TL;DR
This paper introduces STAB, a novel backdoor attack on code models that combines transferability and stealthiness by leveraging sharpness-aware adversarial perturbations and context-aware triggers, without needing complete victim data.
Contribution
STAB is the first attack to effectively combine transferability and stealthiness in code models using sharpness-aware minimization and differentiable trigger search.
Findings
Achieves 73.2% attack success rate after defense.
Outperforms static trigger attacks under defense.
Surpasses dynamic trigger attack by 12.4% in cross-dataset transfer.
Abstract
Code models are increasingly adopted in software development but remain vulnerable to backdoor attacks via poisoned training data. Existing backdoor attacks on code models face a fundamental trade-off between transferability and stealthiness. Static trigger-based attacks insert fixed dead code patterns that transfer well across models and datasets but are easily detected by code-specific defenses. In contrast, dynamic trigger-based attacks adaptively generate context-aware triggers to evade detection but suffer from poor cross-dataset transferability. Moreover, they rely on unrealistic assumptions of identical data distributions between poisoned and victim training data, limiting their practicality. To overcome these limitations, we propose Sharpness-aware Transferable Adversarial Backdoor (STAB), a novel attack that achieves both transferability and stealthiness without requiring…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdversarial Robustness in Machine Learning · Advanced Malware Detection Techniques · Software Engineering Research
