Skip to main content
QUICK REVIEW

[論文レビュー] Vulnerability Mimicking Mutants

Aayush Garg, Renzo Degiovanni|arXiv (Cornell University)|Mar 7, 2023
Software Engineering ResearchComputer Science被引用数 3
ひとこと要約

本稿では、事前学習された言語モデル(例:CodeBERT)が生成するコードの変異(ミューテント)のうち、実際のセキュリティ脆弱性の挙動を意味的に再現する「脆弱性を模倣するミューテント」を特定する機械学習手法VMMSを紹介する。全ミューテントのうちたった3.9%にとどまっているが、45件の解析済み脆弱性の55.6%の失敗挙動を再現しており、VMMSはMCC 0.63、精度0.80、再現率0.51で予測する。手動での特徴量設計を必要としない静的予測の可能性が示された。

ABSTRACT

With the increasing release of powerful language models trained on large code corpus (e.g. CodeBERT was trained on 6.4 million programs), a new family of mutation testing tools has arisen with the promise to generate more "natural" mutants in the sense that the mutated code aims at following the implicit rules and coding conventions typically produced by programmers. In this paper, we study to what extent the mutants produced by language models can semantically mimic the observable behavior of security-related vulnerabilities (a.k.a. Vulnerability-mimicking Mutants), so that designing test cases that are failed by these mutants will help in tackling mimicked vulnerabilities. Since analyzing and running mutants is computationally expensive, it is important to prioritize those mutants that are more likely to be vulnerability mimicking prior to any analysis or test execution. Taking this into account, we introduce VMMS, a machine learning based approach that automatically extracts the features from mutants and predicts the ones that mimic vulnerabilities. We conducted our experiments on a dataset of 45 vulnerabilities and found that 16.6% of the mutants fail one or more tests that are failed by 88.9% of the respective vulnerabilities. More precisely, 3.9% of the mutants from the entire mutant set are vulnerability-mimicking mutants that mimic 55.6% of the vulnerabilities. Despite the scarcity, VMMS predicts vulnerability-mimicking mutants with 0.63 MCC, 0.80 Precision, and 0.51 Recall, demonstrating that the features of vulnerability-mimicking mutants can be automatically learned by machine learning models to statically predict these without the need of investing effort in defining such features.

研究の動機と目的

  • 言語モデルに基づくミューテーションテストツールが、実際のセキュリティ脆弱性と意味的に類似した挙動を示すミューテントを生成できるかどうかを調査すること。
  • 全ミューテントを解析するコストが高いため、実行前に脆弱性を模倣するミューテントの最小集合を同定すること。
  • 手動での特徴量設計を必要としない静的で機械学習に基づく手法を開発し、脆弱性を模倣するミューテントを予測すること。
  • 実際の脆弱性と同じテストで失敗するミューテントを特定するという観点から、その予測の有効性(脆弱性の証明=PoV)を評価すること。

提案手法

  • 研究では、μBERTツールで実装されているように、事前学習済みのCodeBERTモデルを用いてマスクされたトークンの予測によりミューテントを生成する。
  • ミューテントは、各脆弱性の脆弱性の証明(PoV)テストに対するテストスイートの失敗をチェックすることで評価される。
  • 失敗挙動の基準として、Vul4Jデータセットの再現可能な45件の脆弱性が用いられる。
  • 構文的・意味的・構造的特性を含む、ミューテントコードの文脈から特徴量が自動抽出される。
  • ランダムフォレストを用いて、これらの特徴量に基づき、ミューテントが脆弱性を模倣するものかどうかを分類する機械学習モデルを学習する。
  • ミューテントと脆弱性の失敗パターンの類似度を測るために、Ochiai係数が用いられる。
Figure 3 : Overview of VMMS : Source code is abstracted and annotated to represent a mutant which is further flattened to create a single-space-separated sequence of tokens. An encoder-decoder model is trained on sequences to generate mutant embeddings. A classifier is trained on these embeddings an
Figure 3 : Overview of VMMS : Source code is abstracted and annotated to represent a mutant which is further flattened to create a single-space-separated sequence of tokens. An encoder-decoder model is trained on sequences to generate mutant embeddings. A classifier is trained on these embeddings an

実験結果

リサーチクエスチョン

  • RQ1言語モデルが生成するミューテントは、テストの失敗挙動に関して、実際のセキュリティ脆弱性をどの程度意味的に模倣できるか?
  • RQ2手動での特徴量設計を必要とせず、機械学習モデルが脆弱性を模倣するミューテントを正確に予測できるか?
  • RQ3提案手法VMMSは、ベースライン手法と比較して、脆弱性を模倣するミューテントをどの程度効果的に特定できるか?
  • RQ4脆弱性を模倣するミューテントは全ミューテントのうちどの程度の割合を占め、何個の脆弱性をカバーしているか?

主な発見

  • 全ミューテントの16.6%が、対応する脆弱性と同一のテストを失敗させ、実際の検出が可能であることを示している。
  • 全ミューテントのうち、脆弱性を模倣するミューテントはわずか3.9%にとどまり、その重要性にもかかわらず極めて希少であることが明らかになった。
  • これらの脆弱性を模倣するミューテントは、解析済みの45件の脆弱性の55.6%をカバーしており、実際のセキュリティ問題に対する高いカバレッジを示している。
  • VMMSはMCC 0.63を達成しており、中程度から高い予測性能を示している。
  • 精度は0.80で、予測された脆弱性を模倣するミューテントの80%が実際に実際の脆弱性と意味的に類似していることを意味する。
  • 再現率は0.51で、データセット内の実際の脆弱性を模倣するミューテントの約半数をモデルが同定していることを示している。
Figure 4 : RQ2: Distribution of the mutant-vulnerability similarity in terms of Ochiai similarity coefficient across all the vulnerabilities when compared for similarity with the generated mutants. Overall, 16.6% of the mutants fail one or more tests that were failed by 88.9% of the respective vulne
Figure 4 : RQ2: Distribution of the mutant-vulnerability similarity in terms of Ochiai similarity coefficient across all the vulnerabilities when compared for similarity with the generated mutants. Overall, 16.6% of the mutants fail one or more tests that were failed by 88.9% of the respective vulne

この論文を読む

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

Nubintでこの論文を読む

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