Example-Based Vulnerability Detection and Repair in Java Code

Ying Zhang, Ya Xiao, Md Mahir Asef Kabir, Danfeng, Yao +1 more
3/17/2022
cs.CRcs.SE

Official code: NiSE-Virginia-Tech/ying-ICPC-2022 (10 stars, Java, last commit 2022-07-31).

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.

Show full abstract

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 <insecure, secure>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 <insecure, secure> codepairs; Seader successfully inferred 21 unique API-misuse templates and related fixes. With these <vulnerability, fix> patterns, we applied SEADER to a program benchmark that has 86 known vulnerabilities. Seader detected vulnerabilities with 95% precision, 72% recall, and82% 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.

View on arXivView PDF

Code Implementations(1)

Ying Zhang, Ya Xiao, Md Mahir Asef Kabir, Daphne Yao, Na Meng. Example-Based Vulnerability Detection and Repair in Java Code 30th IEEE/ACM International Conference on Program Comprehension

104Java, HTMLMar 12, 20224 years ago

Similar Papers

Cite this paper

@article{zhang2022examplebased,
  title  = {Example-Based Vulnerability Detection and Repair in Java Code},
  author = {Ying Zhang and Ya Xiao and Md Mahir Asef Kabir and Danfeng and Yao and Na Meng},
  year   = {2022},
  eprint = {2203.09009},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.09009}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.09009.svg)](https://codeofpaper.com/paper/2203.09009)

Discussion