Examining Zero-Shot Vulnerability Repair with Large Language Models

被引:0
作者
Pearce, Hammond [1 ]
Tan, Benjamin [2 ]
Ahmad, Baleegh [1 ]
Karri, Ramesh [1 ]
Dolan-Gavitt, Brendan [1 ]
机构
[1] NYU, New York, NY 10003 USA
[2] Univ Calgary, Calgary, AB, Canada
来源
2023 IEEE SYMPOSIUM ON SECURITY AND PRIVACY, SP | 2023年
关键词
Cybersecurity; AI; code generation; CWE;
D O I
暂无
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Human developers can produce code with cybersecurity bugs. Can emerging 'smart' code completion tools help repair those bugs? In this work, we examine the use of large language models (LLMs) for code (such as OpenAI's Codex and AI21's Jurassic J-1) for zero-shot vulnerability repair. We investigate challenges in the design of prompts that coax LLMs into generating repaired versions of insecure code. This is difficult due to the numerous ways to phrase key informationboth semantically and syntactically-with natural languages. We perform a large scale study of five commercially available, blackbox, "off-the-shelf" LLMs, as well as an open-source model and our own locally-trained model, on a mix of synthetic, handcrafted, and real-world security bug scenarios. Our experiments demonstrate that while the approach has promise (the LLMs could collectively repair 100% of our synthetically generated and hand-crafted scenarios), a qualitative evaluation of the model's performance over a corpus of historical real-world examples highlights challenges in generating functionally correct code.
引用
收藏
页码:2339 / 2356
页数:18
相关论文
共 52 条
  • [1] AI21, 2021, JUR 1 LANG MOD AI21
  • [2] AI21, DISC US CAS AI21 STU
  • [3] [Anonymous], VER US GUID VER 4 20
  • [4] Austin J., 2021, ARXIV210807732CS
  • [5] Fix that Fix Commit: A real-world remediation analysis of Java']JavaScript projects
    Bandara, Vinuri
    Rathnayake, Thisura
    Weerasekara, Nipuna
    Elvitigala, Charitha
    Thilakarathna, Kenneth
    Wijesekera, Primal
    Keppitiyagama, Chamath
    [J]. 2020 20TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2020), 2020, : 198 - 202
  • [6] Brown M., 2020, P ADV NEURAL INFORM
  • [7] Chen M., 2021, ARXIV210703374CS
  • [8] SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair
    Chen, Zimin
    Kommrusch, Steve
    Tufano, Michele
    Pouchet, Louis-Noel
    Poshyvanyk, Denys
    Monperrus, Martin
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (09) : 1943 - 1959
  • [9] Drain D., 2021, P 5 ACM SIGPLAN INT, P1, DOI [DOI 10.1145/3460945.3464951, 10.1145/3460945.3464951]
  • [10] Drechsler R, 2012, INT HIGH LEVEL DESIG, P164, DOI 10.1109/HLDVT.2012.6418259