代码中的无意安全缺陷:基于根因分析的自动化防御
Unintentional Security Flaws in Code: Automated Defense via Root Cause Analysis
AI总结:
本文针对初级开发者难以定位漏洞根因的问题,提出结合 T5 与图卷积网络的自动化根因分析工具 T5-RCGCN,实验表明其可将代码安全性提升 28.9%,并促进开发者长期安全能力成长。
摘要:
软件安全仍然是一个关键问题,尤其是当初级开发者往往缺乏全面的安全实践知识却仍在为代码库做出贡献时。尽管已有工具可以帮助开发者主动编写安全代码,但这些工具在帮助开发者修复其易受攻击代码方面的实际效果在很大程度上仍未得到衡量。此外,这些方法通常侧重于对漏洞进行分类和定位,而没有突出显示作为问题根因的具体代码片段,而这一点对于寻求修复易受攻击代码的开发者而言至关重要。为应对这些挑战,我们开展了一项全面研究,评估现有方法在帮助初级开发者保障其代码安全方面的有效性。我们在五种安全漏洞类型上的发现表明,当前工具仅使开发者能够保护 36.2% 的易受攻击代码。来自这些参与者的问卷结果进一步表明,不知道作为漏洞根因的代码是他们在修复易受攻击代码时面临的主要挑战之一。基于这些见解,我们开发了一个名为 T5-RCGCN 的自动化漏洞根因(RC)工具包,该工具包将 T5 语言模型嵌入与图卷积网络(GCN)相结合,用于漏洞分类和定位。此外,我们集成了 DeepLiftSHAP 来识别作为漏洞根因的代码片段。我们在三个数据集上对 56 名初级开发者测试了 T5-RCGCN,结果显示与先前方法相比,代码安全性提高了 28.9%。使用该工具的开发者还对漏洞根因有了更深入的理解,使其独立保障代码安全的能力提高了 17.0%。这些结果表明,该工具既具有即时增强安全性的潜力,也有助于开发者长期技能成长。
英文摘要:
Software security remains a critical concern, particularly as junior developers, often lacking comprehensive knowledge of security practices, contribute to codebases. While there are tools to help developers proactively write secure code, their actual effectiveness in helping developers fix their vulnerable code remains largely unmeasured. Moreover, these approaches typically focus on classifying and localizing vulnerabilities without highlighting the specific code segments that are the root cause of the issues, a crucial aspect for developers seeking to fix their vulnerable code. To address these challenges, we conducted a comprehensive study evaluating the efficacy of existing methods in helping junior developers secure their code. Our findings across five types of security vulnerabilities revealed that current tools enabled developers to secure only 36.2\% of vulnerable code. Questionnaire results from these participants further indicated that not knowing the code that was the root cause of the vulnerability was one of their primary challenges in repairing the vulnerable code. Informed by these insights, we developed an automated vulnerability root cause (RC) toolkit called T5-RCGCN, that combines T5 language model embeddings with a graph convolutional network (GCN) for vulnerability classification and localization. Additionally, we integrated DeepLiftSHAP to identify the code segments that were the root cause of the vulnerability. We tested T5-RCGCN with 56 junior developers across three datasets, showing a 28.9\% improvement in code security compared to previous methods. Developers using the tool also gained a deeper understanding of vulnerability root causes, resulting in a 17.0\% improvement in their ability to secure code independently. These results demonstrate the tool's potential for both immediate security enhancement and long-term developer skill growth.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。