A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verification
Charalambous, Yiannis, Tihanyi, Norbert, Jain, Ridhi, Sun, Youcheng, Ferrag, Mohamed Amine, Cordeiro, Lucas C.
–arXiv.org Artificial Intelligence
In this paper we present a novel solution that combines the capabilities of Large Language Models (LLMs) with Formal Verification strategies to verify and automatically repair software vulnerabilities. Initially, we employ Bounded Model Checking (BMC) to locate the software vulnerability and derive a counterexample. The counterexample provides evidence that the system behaves incorrectly or contains a vulnerability. The counterexample that has been detected, along with the source code, are provided to the LLM engine. Our approach involves establishing a specialized prompt language for conducting code debugging and generation to understand the vulnerability's root cause and repair the code. Finally, we use BMC to verify the corrected version of the code generated by the LLM. As a proof of concept, we create ESBMC-AI based on the Efficient SMT-based Context-Bounded Model Checker (ESBMC) and a pre-trained Transformer model, specifically gpt-3.5-turbo, to detect and fix errors in C programs. Our experimentation involved generating a dataset comprising 1000 C code samples, each consisting of 20 to 50 lines of code. Notably, our proposed method achieved an impressive success rate of up to 80% in repairing vulnerable code encompassing buffer overflow and pointer dereference failures. We assert that this automated approach can effectively incorporate into the software development lifecycle's continuous integration and deployment (CI/CD) process.
arXiv.org Artificial Intelligence
May-24-2023
- Country:
- North America > Canada
- Europe
- United Kingdom > England
- Greater Manchester > Manchester (0.04)
- Spain > Andalusia
- Málaga Province > Málaga (0.04)
- Germany > Bavaria
- Upper Bavaria > Munich (0.04)
- United Kingdom > England
- Asia > Middle East
- UAE (0.04)
- Genre:
- Research Report
- Promising Solution (0.66)
- New Finding (0.46)
- Research Report
- Industry:
- Information Technology > Security & Privacy (0.82)
- Technology: