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

Java代码中数据驱动的漏洞检测与修复

Data-Driven Vulnerability Detection and Repair in Java Code

Ying Zhang, Mahir Kabir, Ya Xiao, Danfeng, Yao, Na Meng

摘要:

Java平台提供了各种API来促进安全编码。然而,对于缺乏网络安全培训的开发人员来说,正确使用安全API通常具有挑战性。先前的工作表明,许多开发人员滥用安全API;这种滥用可能会将漏洞引入软件,使安全保护无效,并向黑客提供安全漏洞。为了消除这种API相关的漏洞,本文提出了SEADER -我们的新方法,检测和修复安全API滥用。给定一个示例性的不安全代码片段及其安全对应代码片段,SEADER会比较这些代码片段并进行数据依赖性分析,以推断安全API滥用模板和相应的修复操作。根据推断的信息,给定一个程序,SEADER执行过程间静态分析,以搜索任何安全API滥用,并针对这些漏洞提出定制的修复建议。为了评估SEADER,我们将其应用于25个<不安全,安全>代码对,SEADER成功地推断出18个独特的API误用模板和相关修复。通过这些漏洞修复模式,我们进一步将SEADER应用于10个开源项目,这些项目总共包含32个已知漏洞。我们的实验表明,SEADER检测漏洞的准确率为100%,召回率为84%,准确率为91%。此外,我们将SEADER应用于100个Apache开源项目,并检测到988个漏洞; SEADER始终正确地定制修复建议。根据SEADER的输出,我们提交了60个pull requests。截至目前,已有18个项目的开发商对SEADER的建议给予了积极的反馈。我们的研究结果表明,SEADER可以有效地帮助开发人员检测和修复安全API滥用。虽然以前的工作要么检测API滥用或建议简单的修复,SEADER是第一个工具,做这两个重要的漏洞修复。

英文摘要:

Java platform provides various APIs to facilitate secure coding. However, correctly using security APIs is usually challenging for developers who lack cybersecurity training. Prior work shows that many developers misuse security APIs; such misuses can introduce vulnerabilities into software, void security protections, and present security exploits to hackers. To eliminate such API-related vulnerabilities, this paper presents SEADER -- our new approach that detects and repairs security API misuses. Given an exemplar, insecure code snippet, and its secure counterpart, SEADER compares the snippets and conducts data dependence analysis to infer the security API misuse templates and corresponding fixing operations. Based on the inferred information, given a program, SEADER performs inter-procedural static analysis to search for any security API misuse and to propose customized fixing suggestions for those vulnerabilities. To evaluate SEADER, we applied it to 25 <insecure, secure> code pairs, and SEADER successfully inferred 18 unique API misuse templates and related fixes. With these vulnerability repair patterns, we further applied SEADER to 10 open-source projects that contain in total 32 known vulnerabilities. Our experiment shows that SEADER detected vulnerabilities with 100% precision, 84% recall, and 91% accuracy. Additionally, we applied SEADER to 100 Apache open-source projects and detected 988 vulnerabilities; SEADER always customized repair suggestions correctly. Based on SEADER's outputs, we filed 60 pull requests. Up till now, developers of 18 projects have offered positive feedbacks on SEADER's suggestions. Our results indicate that SEADER can effectively help developers detect and fix security API misuses. Whereas prior work either detects API misuses or suggests simple fixes, SEADER is the first tool to do both for nontrivial vulnerability repairs.

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

↑