[논문 리뷰] A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verification
논문은 경계 모델 검사(Bounded Model Checking)와 GPT와 같은 LLM을 결합하여 C 코드 취약점을 탐지, 설명 및 수정하고, 1000-sample 데이터셋에서 최대 80%의 수정 성공률을 달성한다. ESBMC-AI를 도입하여 반례를 통해 코드를 반복적으로 검증하고 수정한다.
This paper introduces an innovative approach that combines Large Language Models (LLMs) with Formal Verification strategies for automatic software vulnerability repair. Initially, we employ Bounded Model Checking (BMC) to identify vulnerabilities and extract counterexamples. These counterexamples are supported by mathematical proofs and the stack trace of the vulnerabilities. Using a specially designed prompt, we combine the original source code with the identified vulnerability, including its stack trace and counterexample that specifies the line number and error type. This combined information is then fed into an LLM, which is instructed to attempt to fix the code. The new code is subsequently verified again using BMC to ensure the fix succeeded. We present the ESBMC-AI framework as a proof of concept, leveraging the well-recognized and industry-adopted Efficient SMT-based Context-Bounded Model Checker (ESBMC) and a pre-trained transformer model to detect and fix errors in C programs, particularly in critical software components. We evaluated our approach on 50,000 C programs randomly selected from the FormAI dataset with their respective vulnerability classifications. Our results demonstrate ESBMC-AI's capability to automate the detection and repair of issues such as buffer overflow, arithmetic overflow, and pointer dereference failures with high accuracy. ESBMC-AI is a pioneering initiative, integrating LLMs with BMC techniques, offering potential integration into the continuous integration and deployment (CI/CD) process within the software development lifecycle.
연구 동기 및 목표
- 형식적 검증과 LLM을 결합하여 소프트웨어 취약점을 수정하는 동기를 제시한다.
- BMC 출력물을 사용하여 LLM을 이끄는 역설적 예시 기반 수정 루프를 보여준다.
- 메모리 안전 문제에 중점을 둔 대규모 합성 C 코드 데이터세트에서 접근 방식을 평가한다.
- CI/CD 파이프라인에 접근 방식을 통합하는 타당성을 보여준다.
제안 방법
- 경계 모델 점검(Bounded Model Checking)을 사용하여 C 프로그램의 취약점을 찾아 반례를 생성한다.
- 디버깅 및 패치 생성을 위한 특수 프롬프트 언어를 가진 LLM에 반례와 소스 코드를 제공한다.
- LLM이 수정된 코드를 생성한 뒤 안전/보안 속성에 대해 다시 BMC로 재검증한다.
- ESBMC-AI를 구현하여 ESBMC와 GPT-3.5-turbo 및 GPT 기반 소프트웨어 검증기 플러그인을 통합한다.
- 20~50줄의 C 코드가 포함된 1000개의 프로그램 데이터세트에서 평가한다.
- 버퍼 오버플로우 및 포인터 역참조와 같은 취약점을 수정하는 성공률이 최대 80%에 달한다고 보고한다.
실험 결과
연구 질문
- RQ1BMC에서 생성된 반례가 LLM 기반 프로그램 수리에 효과적으로 가이드할 수 있는가?
- RQ2ESBMC와 GPT-3.5-turbo의 결합이 C 코드의 메모리 안전 취약점을 수정하는 데 어느 정도까지 효과적인가?
- RQ3검증 피드백이 LLM이 생성한 패치의 품질에 어떤 영향을 미치는가?
- RQ4제안된 ESBMC-AI 프레임워크가 CI/CD 워크플로우에 얼마나 잘 통합될 수 있는가?
주요 결과
- 통합된 접근 방식은 테스트된 취약한 C 샘플의 최대 80%를 수정했다.
- 데이터세트는 각 20–50줄의 코드 샘플 1000개로 구성되었다.
- BMC의 반례를 사용하여 LLM을 올바른 수정으로 유도했다.
- 수정된 코드는 안전 속성을 확인하기 위해 다시 BMC로 재검증되었다.
- ESBMC-AI 프로토타입은 ESBMC와 GPT-3.5-turbo를 결합하여 반복적 수정 및 검증을 시연했다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.