arXiv:2409.00199cs.SEcs.CR2024-09

用AI分析代码漏洞根源,帮新手开发者更准更快修复安全问题。

Unintentional Security Flaws in Code: Automated Defense via Root Cause Analysis

  • 结合T5与图神经网络定位漏洞,再用DeepLiftSHAP找出根本原因代码段。
  • 实测让新手开发者修复率提升28.9%,独立修复能力提高17.0%。
  • 适合想快速提升安全编码能力的新手开发者或团队技术负责人。

软件安全仍是关键挑战,尤其当缺乏安全知识的初级开发者参与代码编写时。现有工具虽能分类和定位漏洞,但很少指出具体导致问题的根本代码段,而这是开发者修复的核心难点。我们对五类安全漏洞进行了评估,发现当前工具仅帮助开发者修复了36.2%的脆弱代码。问卷显示,不了解漏洞根源是主要障碍。基于此,我们开发了自动化漏洞根因分析工具T5-RCGCN,融合T5语言模型嵌入与图卷积网络(GCN)进行漏洞分类与定位,并集成DeepLiftSHAP识别根本原因代码段。在三个数据集上对56名初级开发者测试表明,该工具使代码安全性提升28.9%,开发者对根因的理解加深,独立修复能力提升17.0%。结果证明该工具兼具即时安全增强与长期技能培养潜力。

原文摘要 · Abstract (English)

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辅助开发者工具

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。