Securing Code Understanding: Detecting Natural Backdoor Vulnerability in Code Language Models

IF 6 1区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING
IEEE Transactions on Software Engineering Pub Date : 2026-10-01 Epub Date: 2026-06-16 DOI:10.1109/TSE.2026.3704372
Yuchen Chen;Weisong Sun;Haocheng Huang;Yuan Xiao;Chunrong Fang;Yiran Zhang;Tingting Xu;Zhenpeng Chen;An Guo;Peizhuo Lv;Xiaofang Zhang;Zhenyu Chen;Yang Liu;Baowen Xu
{"title":"Securing Code Understanding: Detecting Natural Backdoor Vulnerability in Code Language Models","authors":"Yuchen Chen;Weisong Sun;Haocheng Huang;Yuan Xiao;Chunrong Fang;Yiran Zhang;Tingting Xu;Zhenpeng Chen;An Guo;Peizhuo Lv;Xiaofang Zhang;Zhenyu Chen;Yang Liu;Baowen Xu","doi":"10.1109/TSE.2026.3704372","DOIUrl":null,"url":null,"abstract":"Code Language Models (CodeLMs) have become integral to software engineering, significantly advancing code intelligence tasks. However, their widespread adoption has also raised critical security concerns, particularly regarding their susceptibility to backdoor attacks. Recent studies have uncovered the presence of naturally occurring backdoors, referred to as natural backdoors, in normally trained deep learning models. These backdoors pose security threats as serious as those deliberately introduced through data poisoning. Nevertheless, research on the security implications of such natural backdoor vulnerabilities in CodeLMs remains scarce and lacks systematic investigation. In this paper, we conduct a thorough empirical study of natural backdoor vulnerabilities in CodeLMs, covering various model architectures and code intelligence tasks. Specifically, we first examine potential natural backdoor vulnerabilities in CodeLMs across 44 different scenarios, demonstrating that natural backdoors are prevalent and intrinsic to these CodeLMs. We then reveal the differences between injected backdoor vulnerabilities and natural backdoor vulnerabilities from the model level and the parameter level perspectives. Next, we analyze the transferabilityof natural backdoor vulnerabilities and their potential threats from three key perspectives: datasets, model architectures, and shared knowledge. We further conduct an in-depth analysis of the causes of natural backdoors in CodeLMs from two critical aspects: training datasets and the model training procedure. Furthermore, we evaluate the effectiveness of existing backdoor defense techniques, including pre-training, in-training, and post-training defenses, in mitigating natural backdoors in CodeLMs. Finally, we propose a novel detection method, <sc>ScanNBT</small>, designed to improve the comprehensive detection of potential natural backdoor vulnerabilities in CodeLMs. We aim for our findings to enhance the understanding of natural backdoor vulnerabilities in CodeLMs and provide valuable insights for strengthening their security against backdoor threats.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"52 10","pages":"2855-2874"},"PeriodicalIF":6.0000,"publicationDate":"2026-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/11568189/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/6/16 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

Code Language Models (CodeLMs) have become integral to software engineering, significantly advancing code intelligence tasks. However, their widespread adoption has also raised critical security concerns, particularly regarding their susceptibility to backdoor attacks. Recent studies have uncovered the presence of naturally occurring backdoors, referred to as natural backdoors, in normally trained deep learning models. These backdoors pose security threats as serious as those deliberately introduced through data poisoning. Nevertheless, research on the security implications of such natural backdoor vulnerabilities in CodeLMs remains scarce and lacks systematic investigation. In this paper, we conduct a thorough empirical study of natural backdoor vulnerabilities in CodeLMs, covering various model architectures and code intelligence tasks. Specifically, we first examine potential natural backdoor vulnerabilities in CodeLMs across 44 different scenarios, demonstrating that natural backdoors are prevalent and intrinsic to these CodeLMs. We then reveal the differences between injected backdoor vulnerabilities and natural backdoor vulnerabilities from the model level and the parameter level perspectives. Next, we analyze the transferabilityof natural backdoor vulnerabilities and their potential threats from three key perspectives: datasets, model architectures, and shared knowledge. We further conduct an in-depth analysis of the causes of natural backdoors in CodeLMs from two critical aspects: training datasets and the model training procedure. Furthermore, we evaluate the effectiveness of existing backdoor defense techniques, including pre-training, in-training, and post-training defenses, in mitigating natural backdoors in CodeLMs. Finally, we propose a novel detection method, ScanNBT, designed to improve the comprehensive detection of potential natural backdoor vulnerabilities in CodeLMs. We aim for our findings to enhance the understanding of natural backdoor vulnerabilities in CodeLMs and provide valuable insights for strengthening their security against backdoor threats.
保护代码理解:检测代码语言模型中的自然后门漏洞
代码语言模型(Code Language Models, codelm)已经成为软件工程中不可或缺的一部分,显著地推进了代码智能任务。然而,它们的广泛采用也引发了严重的安全问题,特别是它们容易受到后门攻击。最近的研究发现,在正常训练的深度学习模型中存在自然发生的后门,称为自然后门。这些后门构成的安全威胁与故意通过数据中毒引入的威胁一样严重。然而,对codelm中这种自然后门漏洞的安全影响的研究仍然很少,缺乏系统的调查。在本文中,我们对codelm中的自然后门漏洞进行了深入的实证研究,涵盖了各种模型架构和代码智能任务。具体来说,我们首先在44种不同的场景中检查codelm中潜在的自然后门漏洞,证明自然后门是普遍存在的,并且是这些codelm固有的。然后从模型级和参数级两方面揭示了注入后门漏洞与自然后门漏洞的区别。接下来,我们从三个关键角度分析了自然后门漏洞的可转移性及其潜在威胁:数据集、模型架构和共享知识。我们进一步从两个关键方面深入分析了codelm中自然后门的原因:训练数据集和模型训练过程。此外,我们评估了现有后门防御技术的有效性,包括预训练、训练中和训练后防御,以减轻codelm中的自然后门。最后,我们提出了一种新的检测方法——ScanNBT,旨在提高对codelm中潜在自然后门漏洞的全面检测。我们的研究结果旨在增强对codelm中自然后门漏洞的理解,并为加强其针对后门威胁的安全性提供有价值的见解。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering 工程技术-工程:电子与电气
CiteScore
9.70
自引率
10.80%
发文量
724
审稿时长
6 months
期刊介绍: IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include: a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models. b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects. c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards. d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues. e) System issues: Hardware-software trade-offs. f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书