Skip to main content
QUICK REVIEW

[論文レビュー] How well does LLM generate security tests?

Ying Zhang, Wenjia Song|arXiv (Cornell University)|Oct 1, 2023
Web Application Security Vulnerabilities被引用数 12
ひとこと要約

研究は ChatGPT-4.0 を使用して、脆弱なライブラリを含むアプリの概念実証セキュリティテストを生成し、55 のタスクにわたって24の悪用可能なテストを示し、SIEGE および TRANSFER を上回る。

ABSTRACT

Developers often build software on top of third-party libraries (Libs) to improve programmer productivity and software quality. The libraries may contain vulnerabilities exploitable by hackers to attack the applications (Apps) built on top of them. People refer to such attacks as supply chain attacks, the documented number of which has increased 742% in 2022. People created tools to mitigate such attacks, by scanning the library dependencies of Apps, identifying the usage of vulnerable library versions, and suggesting secure alternatives to vulnerable dependencies. However, recent studies show that many developers do not trust the reports by these tools; they ask for code or evidence to demonstrate how library vulnerabilities lead to security exploits, in order to assess vulnerability severity and modification necessity. Unfortunately, manually crafting demos of application-specific attacks is challenging and time-consuming, and there is insufficient tool support to automate that procedure. In this study, we used ChatGPT-4.0 to generate security tests, and to demonstrate how vulnerable library dependencies facilitate the supply chain attacks to given Apps. We explored various prompt styles/templates, and found that ChatGPT-4.0 generated tests for all 55 Apps, demonstrating 24 attacks successfully. It outperformed two state-of-the-art security test generators -- TRANSFER and SIEGE -- by generating a lot more tests and achieving more exploits. ChatGPT-4.0 worked better when prompts described more on the vulnerabilities, possible exploits, and code context. Our research will shed light on new research in security test generation. The generated tests will help developers create secure by design and secure by default software.

研究の動機と目的

  • ライブラリの脆弱性がどのように依存アプリへ伝播するかを実証することで、サプライチェーン攻撃の緩和を促す。
  • 大規模言語モデルが実行可能なセキュリティテストを生成し、悪用経路を示すことができるかを評価する。
  • LLM が生成したテストを、最先端のテスト生成ツールと比較して有効性と実用性を評価する。

提案手法

  • 脆弱なライブラリバージョンに依存する Apps-Lib ペアの55 4 のデータセットを作成する。
  • ChatGPT(デフォルトおよびバリアント)に対して、模範的な悪用を模倣するセキュリティテストを生成する複数のプロンプトを設計する。
  • フェーズ別評価:生成されたテストを Apps に統合し、コンパイルしてテストを実行し、挙動と悪用を検証する。
  • 成果を評価するために3つの指標(App-Lib テスト適用性、テストのコンパイル可能性、実際の脆弱性悪用)を用いる。
  • 同じデータセット上で、ChatGPT の結果をツール SIEGE および TRANSFER の2つと比較する。
  • 成功/失敗要因を分析し、結果に最も影響を与えるプロンプト内の情報要素を特定する。
Figure 1. Our default usage of ChatGPT to generate security tests
Figure 1. Our default usage of ChatGPT to generate security tests

実験結果

リサーチクエスチョン

  • RQ1RQ1: ChatGPT は、脆弱な Libs を持つ Apps のセキュリティテストをどれだけ効果的に生成できるか?
  • RQ2RQ2: プロンプト設計(含まれる情報)が、テスト生成における ChatGPT の性能にどう影響するか?
  • RQ3RQ3: 既存のセキュリティテスト生成ツール(SIEGE、TRANSFER)と比較して、ChatGPT の性能はどうか?

主な発見

  • ChatGPT は全55プロンプトに対してテストを生成し、26件がコンパイル可能・実行可能で、14件は軽微な修正後にコンパイル可能となり、合計40件がコンパイル可能なテストとなった。
  • コンパイル可能なテストのうち24件が既知の脆弱性をうまく悪用し、概念実証の悪用を示した。
  • 55 アプリのデータセットに対して、ChatGPT は TRANSFER を上回り(4つの脆弱性を悪用)、SIEGE は悪用なしだった。
  • Lib からの脆弱性特化テストがなければ、生成されたテストのいずれも脆弱性を悪用できず、プロンプトにおける脆弱性の詳細な文脈の重要性を強調する。
  • 脆弱性、悪用、およびコード文脈についてより記述的な情報を含むプロンプトは性能を改善し、特に脆弱性テスト要素が決定的に重要だった。
  • 生成されたテストの一部はコンパイルされなかった(55件中15件)ことがあり、ツールのモックや欠落・不正確なプログラム要素に起因することが多く、自動テスト合成の限界を示している。
Figure 2. Our prompt template
Figure 2. Our prompt template

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。