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.


翻译:神经代码模型已日益融入软件开发流程。然而,其易受后门攻击的特性构成了重大安全风险。当前的前沿认知主要集中于基于注入的攻击,这类攻击通过在软件代码中插入异常模式实现。此类攻击可通过标准净化技术予以消除。这种现状可能导致对后门攻击产生错误的安全认知。本文提出一种新型后门攻击——基于语义等价变换的后门攻击,该攻击利用语义保持的低频代码变换生成隐蔽触发器。我们提出了指导此类触发器生成的框架。通过在五项任务、六种编程语言以及CodeBERT、CodeT5和StarCoder等模型上的实验表明,基于语义等价变换的攻击在保持模型效用的同时实现了高成功率(通常>90%)。该攻击具有高度隐蔽性,能够规避现有先进防御机制,其平均检测率较基于注入的攻击低25.13%以上。我们对基于归一化的防御措施进行评估,发现其仅能提供部分缓解,这证实了该攻击的鲁棒性。这些研究结果推动了对针对基于语义等价变换攻击的可扩展防御机制的进一步探索。

0
下载
关闭预览

相关内容

KnowledGPT:基于知识库的检索和存储访问增强大型语言模型
【ICML2023】SEGA:结构熵引导的图对比学习锚视图
专知会员服务
23+阅读 · 2023年5月10日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员