arrow
Return

Stealthy Backdoor Attack for Code Models

delete2024-04-01
delete10
delete
OA
AI
Z
Zhou Yang
B
Bowen Xu *
J
Jie M. Zhang
H
Hong Jin Kang
J
Jieke Shi
J
Junda He
David Lo cover
David Lo (David Lo)
DOI:10.1109/TSE.2024.3361661delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code models, such as CodeBERT and CodeT5, offer general-purpose representations of code and play a vital role in supporting downstream automated software engineering tasks. Most recently, code models were revealed to be vulnerable to backdoor attacks. A code model that is backdoor-attacked can behave normally on clean examples but will produce pre-defined malicious outputs on examples injected with triggers that activate the backdoors. Existing backdoor attacks on code models use unstealthy and easy-to-detect triggers. This paper aims to investigate the vulnerability of code models with stealthy backdoor attacks. To this end, we propose Afraidoor (Adversarial Feature as Adaptive Backdoor). Afraidoor achieves stealthiness by leveraging adversarial perturbations to inject adaptive triggers into different inputs. We apply Afraidoor to three widely adopted code models (CodeBERT, PLBART, and CodeT5) and two downstream tasks (code summarization and method name prediction). We evaluate three widely used defense methods and find that Afraidoor is more unlikely to be detected by the defense methods than by baseline methods. More specifically, when using spectral signature as defense, around 85% of adaptive triggers in Afraidoor bypass the detection in the defense process. By contrast, only less than 12% of the triggers from previous work bypass the defense. When the defense method is not applied, both Afraidoor and baselines have almost perfect attack success rates. However, once a defense is applied, the attack success rates of baselines decrease dramatically, while the success rate of Afraidoor remains high. Our finding exposes security weaknesses in code models under stealthy backdoor attacks and shows that state-of-the-art defense methods cannot provide sufficient protection. We call for more research efforts in understanding security threats to code models and developing more effective countermeasures.
Keywords:
Adversarial attack
data poisoning
backdoor attack
pre-trained models of code
Misactivation-Aware Stealthy Backdoor Attacks on Neural Code Understanding Models
err2025-09-26
err0
PREAI
errXiaobing Sun; Yiran Xiao; Lili Bo; Weisong Sun; Xiangyue Liu; Bin Li; Jiale Zhang
errShare
errSave
errShare
errSave
SGBA: A stealthy scapegoat backdoor attack against deep neural networks
err2024-01-01
err1
errOAAI
errHe, Ying; Shen, Zhili; Xia, Chang; Hua, Jingyu; Tong, Wei; Zhong, Sheng
errShare
errSave
Cracking the Code of Backdoor Attacks With Confidence Consistency
err2026-01-12
err0
PREAI
errZhen Zhuang; Yijian Ding; Shuyu Zheng; Jun Shao; Donghai Zhu; Huiyan Wang
errShare
errSave
Adversarial Training for Mitigating Insider-Driven XAI-Based Backdoor Attacks
err2025-05-06
err0
errOAAI
errGayathri, R. G.; Sajjanhar, Atul; Xiang, Yong
errShare
errSave
A Wolf in Sheep’s Clothing: Unveiling a Stealthy Backdoor Attack in Subgraph Federated Learning
err2026-01-28
err0
PREAI
errHao Yu; Wenjing Yang; Chuan Ma; Lingyuan Meng; Liang Du; Tao Xiang; Xinwang Liu; Kunlun He
errShare
errSave

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
3.0K
Citations:
1.3W

Organization

S
Singapore Management University
Scholars:
229
Papers: 159
Citations: 2.3K
N
North Carolina State University
Scholars:
1.5K
Papers: 646
Citations: 1.7W
U
University of London
Scholars:
1.7K
Papers: 763
Citations: 14.7W
researcher View more organizations
Cited Papers

Cited Papers

Towards Understanding and Mitigating Audio Adversarial Examples for Speaker Recognition
err2023-09-01
err14
errOAAI
errChen, Guangke; Zhao, Zhe; Song, Fu; Chen, Sen; Fan, Lingling; Wang, Feng; Wang, Jiashui
errShare
errSave
A Versatile One-pot Synthesis of Symmetrical N-Tosylazamacrocycles
err1985-01-01
err0
errOAAI
errSebastiano Pappalardo; Francesco Bottino; Michele Di Grazia; Paolo Finocchiaro; Antonino Mamo
errShare
errSave
Mistuning Identification and Model Updating of an Industrial Blisk
err2007-01-01
err0
errOAAI
errD. Laxalde; F. Thouverez; J.-J. Sinou; J.-P. Lombard; S. Baumhauer
errShare
errSave
errShare
errSave
BadNets: Evaluating Backdooring Attacks on Deep Neural Networks
err2019-01-01
err665
errOAAI
errGu, Tianyu; Liu, Kang; Dolan-Gavitt, Brendan; Garg, Siddharth
errShare
errSave
errShare
errSave
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
errShare
errSave
researcher View more