Can LLMs Patch Security Issues?
Large Language Models (LLMs) have shown impressive proficiency in code generation. Unfortunately, these models share a weakness with their human counterparts: producing code that inadvertently has security vulnerabilities. These vulnerabilities could allow unauthorized attackers to access sensitive...
Gespeichert in:
Hauptverfasser: | , , , |
---|---|
Format: | Artikel |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | Large Language Models (LLMs) have shown impressive proficiency in code
generation. Unfortunately, these models share a weakness with their human
counterparts: producing code that inadvertently has security vulnerabilities.
These vulnerabilities could allow unauthorized attackers to access sensitive
data or systems, which is unacceptable for safety-critical applications. In
this work, we propose Feedback-Driven Security Patching (FDSP), where LLMs
automatically refine generated, vulnerable code. Our approach leverages
automatic static code analysis to empower the LLM to generate and implement
potential solutions to address vulnerabilities. We address the research
communitys needs for safe code generation by introducing a large-scale dataset,
PythonSecurityEval, covering the diversity of real-world applications,
including databases, websites and operating systems. We empirically validate
that FDSP outperforms prior work that uses self-feedback from LLMs by up to
17.6% through our procedure that injects targeted, external feedback. Code and
data are available at \url{https://github.com/Kamel773/LLM-code-refine} |
---|---|
DOI: | 10.48550/arxiv.2312.00024 |