Examining Zero-Shot Vulnerability Repair with Large Language Models
Authors:
Top Cited Papers
- 1 May 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 2339-2356
Abstract
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 information— both semantically and syntactically—with natural languages. We perform a large scale study of five commercially available, black-box, "off-the-shelf" LLMs, as well as an open-source model and our own locally-trained model, on a mix of synthetic, hand-crafted, 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.Keywords
This publication has 24 references indexed in Scilit:
- Fuzzing: a surveyCybersecurity, 2018
- A Large-Scale Empirical Study of Security Patches2017
- Failure sketching2015
- An analysis of patch plausibility and correctness for generate-and-validate patch generation systems2015
- Quality analysis of source code comments2013
- Using likely invariants for automated software fault localization2013
- Generating formal system models from natural language descriptions2012
- NLP (Natural Language Processing) for NLP (Natural Language Programming)2006
- Simplifying and isolating failure-inducing inputIEEE Transactions on Software Engineering, 2002
- Isolating failure-inducing thread schedules2002