Example-Based Vulnerability Detection and Repair in Java Code

Y. Zhang, Ya Xiao, Md Mahir Asef Kabir, D. Yao, Na Meng
{"title":"Example-Based Vulnerability Detection and Repair in Java Code","authors":"Y. Zhang, Ya Xiao, Md Mahir Asef Kabir, D. Yao, Na Meng","doi":"10.1145/3524610.3527895","DOIUrl":null,"url":null,"abstract":"The Java libraries JCA and JSSE offer cryptographic APIs to facilitate secure coding. When developers misuse some of the APIs, their code becomes vulnerable to cyber-attacks. To eliminate such vulnerabilities, people built tools to detect security-API misuses via pattern matching. However, most tools do not (1) fix misuses or (2) allow users to extend tools' pattern sets. To overcome both limitations, we created Seader-an example-based approach to detect and repair security-API misuses. Given an exemplar $\\langle\\text{insecure, secure}\\rangle$ code pair, Seader compares the snippets to infer any API-misuse template and corresponding fixing edit. Based on the inferred info, given a program, Seader performs inter-procedural static analysis to search for security-API misuses and to propose customized fixes. For evaluation, we applied Seader to 28 $\\langle\\text{insecure, secure}\\rangle$ code pairs; Seader successfully inferred 21 unique API-misuse templates and related fixes. With these $\\langle\\text{vulnerability, fix}\\rangle$ patterns, we applied Seader to a program benchmark that has 86 known vulnerabilities. Seader detected vulnerabilities with 95% precision, 72% recall, and 82% F-score. We also applied Seader to 100 open-source projects and manually checked 77 suggested repairs; 76 of the repairs were correct. Seader can help developers correctly use security APIs.","PeriodicalId":426634,"journal":{"name":"2022 IEEE/ACM 30th International Conference on Program Comprehension (ICPC)","volume":"51 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-03-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE/ACM 30th International Conference on Program Comprehension (ICPC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3524610.3527895","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12

Abstract

The Java libraries JCA and JSSE offer cryptographic APIs to facilitate secure coding. When developers misuse some of the APIs, their code becomes vulnerable to cyber-attacks. To eliminate such vulnerabilities, people built tools to detect security-API misuses via pattern matching. However, most tools do not (1) fix misuses or (2) allow users to extend tools' pattern sets. To overcome both limitations, we created Seader-an example-based approach to detect and repair security-API misuses. Given an exemplar $\langle\text{insecure, secure}\rangle$ code pair, Seader compares the snippets to infer any API-misuse template and corresponding fixing edit. Based on the inferred info, given a program, Seader performs inter-procedural static analysis to search for security-API misuses and to propose customized fixes. For evaluation, we applied Seader to 28 $\langle\text{insecure, secure}\rangle$ code pairs; Seader successfully inferred 21 unique API-misuse templates and related fixes. With these $\langle\text{vulnerability, fix}\rangle$ patterns, we applied Seader to a program benchmark that has 86 known vulnerabilities. Seader detected vulnerabilities with 95% precision, 72% recall, and 82% F-score. We also applied Seader to 100 open-source projects and manually checked 77 suggested repairs; 76 of the repairs were correct. Seader can help developers correctly use security APIs.
Java代码中基于示例的漏洞检测和修复
Java库JCA和JSSE提供了加密api,以促进安全编码。当开发人员误用某些api时,他们的代码就容易受到网络攻击。为了消除这些漏洞,人们构建了通过模式匹配来检测安全api滥用的工具。然而,大多数工具并没有(1)修正误用或(2)允许用户扩展工具的模式集。为了克服这两个限制,我们创建了seader——一种基于示例的方法来检测和修复安全api的滥用。给定一个范例$\ rangle \text{insecure, secure}\rangle$代码对,Seader比较这些代码片段以推断出任何api误用的模板和相应的修复编辑。基于推断的信息,给定一个程序,Seader执行过程间静态分析以搜索安全api的滥用并提出定制的修复方案。为了评估,我们对28对$\ rangle \text{insecure, secure}\rangle$代码对应用Seader;Seader成功推断出21个独特的api误用模板和相关修复。有了这些$\ rangle \text{vulnerability, fix}\rangle$模式,我们将Seader应用到一个有86个已知漏洞的程序基准测试中。Seader检测漏洞的准确率为95%,召回率为72%,f值为82%。我们还将Seader应用于100个开源项目,并手动检查了77个建议的修复;76次修理是正确的。Seader可以帮助开发人员正确使用安全性api。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
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学术官方微信