arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.02496cs.CRcs.SE
收藏

针对代码模型的隐蔽后门攻击

Stealthy Backdoor Attack for Code Models

Zhou Yang, Bowen Xu, Jie M. Zhang, Hong Jin Kang, Jieke Shi, Junda He, David Lo

AI总结:

针对现有代码模型后门攻击触发器易被检测的问题,提出基于对抗扰动的自适应隐蔽后门攻击方法AFRAIDOOR,实验证明其绕防能力与攻击成功率远高于基线方法,暴露了现有防御的不足。

摘要:

代码模型(如CodeBERT、CodeT5)可提供通用的代码表示,在支撑下游自动化软件工程任务中发挥着关键作用。近期研究发现,代码模型易受后门攻击:遭受后门攻击的代码模型在干净样本上表现正常,但在注入了可激活后门的触发器的样本上,会生成预设的恶意输出。现有针对代码模型的后门攻击采用的触发器隐蔽性差,且极易被检测。本文旨在研究代码模型在隐蔽后门攻击下的脆弱性。为此,我们提出AFRAIDOOR(对抗特征作为自适应后门)。AFRAIDOOR通过利用对抗扰动,向不同输入注入自适应触发器,从而实现隐蔽性。我们在三种广泛使用的代码模型(CodeBERT、PLBART和CodeT5)以及两个下游任务(代码摘要生成和方法名预测)上对AFRAIDOOR进行了评估。研究发现,AFRAIDOOR中约85%的自适应触发器可绕过防御流程的检测。相比之下,以往研究的触发器中仅有不到12%能绕过防御。在未应用防御方法时,AFRAIDOOR和基线方法的攻击成功率几乎都达到完美水平。但一旦应用防御措施,基线方法的成功率大幅降至10.47%和12.06%,而AFRAIDOOR在两项任务上的成功率分别为77.05%和92.98%。我们的发现揭示了代码模型在隐蔽后门攻击下的安全弱点,表明当前最先进的防御方法无法提供足够的保护。我们呼吁更多研究投入到理解代码模型的安全威胁、开发更有效防御措施的工作中。

英文摘要:

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 evaluate AFRAIDOOR on three widely adopted code models (CodeBERT, PLBART and CodeT5) and two downstream tasks (code summarization and method name prediction). We find that 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 success rates of baselines decrease dramatically to 10.47% and 12.06%, while the success rate of AFRAIDOOR are 77.05% and 92.98% on the two tasks. Our finding exposes security weaknesses in code models under stealthy backdoor attacks and shows that the state-of-the-art defense method cannot provide sufficient protection. We call for more research efforts in understanding security threats to code models and developing more effective countermeasures.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑