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

基于语义等价变换的神经代码模型后门攻击:特性与缓解

Semantically-Equivalent Transformations-Based Backdoor Attacks against Neural Code Models: Characterization and Mitigation

Huazhong University of Science and Technology(华中科技大学);University of Colorado Colorado Springs(科罗拉多大学科泉分校)

Junyao Ye, Zhen Li, Xi Tang, Shouhuai Xu, Deqing Zou, Zhongsheng Yuan

AI总结:

本文提出基于语义等价变换的后门攻击方法,通过低频代码变换生成隐蔽触发器,实验显示其高成功率和隐蔽性,揭示了现有防御措施的不足。

摘要:

神经代码模型已被越来越多地纳入软件开发过程。然而,它们对后门攻击的易受攻击性带来了显著的安全风险。目前的最新理解集中在注入式攻击上,这些攻击将异常模式插入到软件代码中。这些攻击可以被标准的清理技术中和。这种现状可能导致对后门攻击的虚假安全感。在本文中,我们介绍了一种新的后门攻击类型,称为语义等价变换(SET)-基于的后门攻击,它使用保持语义的低频代码变换来生成隐蔽的触发器。我们提出了一种框架来指导此类触发器的生成。我们的实验涵盖五个任务、六种语言和CodeBERT、CodeT5和StarCoder等模型,显示SET攻击在保持模型效用的同时实现了高成功率(通常超过90%)。该攻击证明非常隐蔽,能够逃避最先进的防御措施,检测率平均比注入式攻击低25.13%以上。我们评估了基于归一化的缓解措施,发现它们只能提供部分缓解,证实了攻击的鲁棒性。这些结果促使进一步研究针对SET攻击的可扩展防御。

英文摘要:

Neural code models have been increasingly incorporated into software development processes. However, their susceptibility to backdoor attacks presents a significant security risk. The state-of-the-art understanding focuses on injection-based attacks, which insert anomalous patterns into software code. These attacks can be neutralized by standard sanitization techniques. This status quo may lead to a false sense of security regarding backdoor attacks. In this paper, we introduce a new kind of backdoor attacks, dubbed Semantically-Equivalent Transformation (SET)-based backdoor attacks, which use semantics-preserving low-prevalence code transformations to generate stealthy triggers. We propose a framework to guide the generation of such triggers. Our experiments across five tasks, six languages, and models like CodeBERT, CodeT5, and StarCoder show that SET-based attacks achieve high success rates (often >90%) while preserving model utility. The attack proves highly stealthy, evading state-of-the-art defenses with detection rates on average over 25.13% lower than injection-based counterparts. We evaluate normalization-based countermeasures and find they offer only partial mitigation, confirming the attack's robustness. These results motivate further investigation into scalable defenses tailored to SET-based attacks.

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

↑