Skip to main content
QUICK REVIEW

[論文レビュー] A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verification

Norbert Tihanyi, Ridhi Jain|arXiv (Cornell University)|May 24, 2023
Software Engineering ResearchComputer Science被引用数 30
ひとこと要約

この論文は bounded model checking をGPT風のLLMと組み合わせてCコードの脆弱性を検出・説明・修正を行い、1000サンプルデータセットで最大80%の修正成功を達成する。ESBMC-AIを導入し、カウンター例を介してコードの反復的検証と修正を行う。

ABSTRACT

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.

研究の動機と目的

  • 正式検証とLLMsを組み合わせてソフトウェアの脆弱性を修復する動機づけ。
  • BMCの出力を導く修正ループを示すカウンター例に基づく修復ループを示す。
  • メモリ安全性の問題に焦点を当てた大規模な合成Cコードデータセットで手法を評価する。
  • CI/CDパイプラインへの統合の実現可能性を示す。

提案手法

  • Cプログラムの脆弱性を特定し、カウンター例を生成する境界付きモデル検査を用いる。
  • カウンター例とソースコードをデバッグ用・パッチ生成用の専門プロンプト言語を備えたLLMに提供する。
  • LLMが修正済みコードを生成し、それを安全性/セキュリティ特性のために再度BMCで検証する。
  • ESBMC-AIを実装する際、ESBMCとGPT-3.5-turboおよびGPTベースのソフトウェア検証プラグインを統合する。
  • 1000個のCプログラム(各20–50行)データセットで評価する。
  • バッファオーバーフローやポインタデリファレンスなどの脆弱性の修復で最大80%の成功率を報告する。

実験結果

リサーチクエスチョン

  • RQ1BMC生成のカウンター例はLLMベースのプログラム修復を効果的に導くことができるか?
  • RQ2ESBMCとGPT-3.5-turboの組み合わせはCコードのメモリ安全性の脆弱性をどの程度修復できるか?
  • RQ3検証フィードバックがLLMsによって作成されるパッチの品質に与える影響は?
  • RQ4提案されたESBMC-AIフレームワークはCI/CDワークフローにどれだけ統合できるか?

主な発見

  • 統合アプローチは試験対象の脆弱なCサンプルの最大80%を修復した。
  • データセットは各20–50行の1000コードサンプルで構成されていた。
  • BMCからのカウンター例をLLMsが正しい修正に向かうよう誘導するのに用いた。
  • 修正されたコードは安全性特性を確認するために再度BMCで検証された。
  • ESBMC-AIプロトタイプはESBMCとGPT-3.5-turboを組み合わせ、反復的な修復と検証を実演した。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。