Previous Article in Journal
MalVis: Large-Scale Bytecode Visualization Framework for Explainable Android Malware Detection
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Leveraging Static Analysis for Feedback-Driven Security Patching in LLM-Generated Code

School of Interactive Computing, Georgia Institute of Technology, Atlanta, GA 30332, USA
*
Author to whom correspondence should be addressed.
J. Cybersecur. Priv. 2025, 5(4), 110; https://doi.org/10.3390/jcp5040110 (registering DOI)
Submission received: 2 October 2025 / Revised: 1 November 2025 / Accepted: 13 November 2025 / Published: 5 December 2025
(This article belongs to the Section Security Engineering & Applications)

Abstract

Large language models (LLMs) have shown remarkable potential for automatic code generation. Yet, these models share a weakness with their human counterparts: inadvertently generating code with security vulnerabilities that could allow unauthorized attackers to access sensitive data or systems. In this work, we propose Feedback-Driven Security Patching (FDSP), wherein LLMs automatically refine vulnerable generated code. The key to our approach is a unique framework that leverages automatic static code analysis to enable the LLM to create and implement potential solutions to code vulnerabilities. Further, we curate a novel benchmark, PythonSecurityEval, that can accelerate progress in the field of code generation by covering diverse, real-world applications, including databases, websites, and operating systems. Our proposed FDSP approach achieves the strongest improvements, reducing vulnerabilities by up to 33% when evaluated with Bandit and 12% with CodeQL and outperforming baseline refinement methods.
Keywords: large language models; secure AI code; security patching large language models; secure AI code; security patching

Share and Cite

MDPI and ACS Style

Alrashedy, K.; Aljasser, A.; Tambwekar, P.; Gombolay, M. Leveraging Static Analysis for Feedback-Driven Security Patching in LLM-Generated Code. J. Cybersecur. Priv. 2025, 5, 110. https://doi.org/10.3390/jcp5040110

AMA Style

Alrashedy K, Aljasser A, Tambwekar P, Gombolay M. Leveraging Static Analysis for Feedback-Driven Security Patching in LLM-Generated Code. Journal of Cybersecurity and Privacy. 2025; 5(4):110. https://doi.org/10.3390/jcp5040110

Chicago/Turabian Style

Alrashedy, Kamel, Abdullah Aljasser, Pradyumna Tambwekar, and Matthew Gombolay. 2025. "Leveraging Static Analysis for Feedback-Driven Security Patching in LLM-Generated Code" Journal of Cybersecurity and Privacy 5, no. 4: 110. https://doi.org/10.3390/jcp5040110

APA Style

Alrashedy, K., Aljasser, A., Tambwekar, P., & Gombolay, M. (2025). Leveraging Static Analysis for Feedback-Driven Security Patching in LLM-Generated Code. Journal of Cybersecurity and Privacy, 5(4), 110. https://doi.org/10.3390/jcp5040110

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop