[論文レビュー] Automated software vulnerability detection with machine learning
データ駆動型 ML アプローチは、ソースベースおよびビルドベースの特徴を用いて C/C++ 関数の脆弱性を検出します。最良のモデル(TextCNN の特徴を Extra-Trees 分類器へ投入)は、PR AUC 0.49 および ROC AUC 0.87 を達成します。
Thousands of security vulnerabilities are discovered in production software each year, either reported publicly to the Common Vulnerabilities and Exposures database or discovered internally in proprietary code. Vulnerabilities often manifest themselves in subtle ways that are not obvious to code reviewers or the developers themselves. With the wealth of open source code available for analysis, there is an opportunity to learn the patterns of bugs that can lead to security vulnerabilities directly from data. In this paper, we present a data-driven approach to vulnerability detection using machine learning, specifically applied to C and C++ programs. We first compile a large dataset of hundreds of thousands of open-source functions labeled with the outputs of a static analyzer. We then compare methods applied directly to source code with methods applied to artifacts extracted from the build process, finding that source-based models perform better. We also compare the application of deep neural network models with more traditional models such as random forests and find the best performance comes from combining features learned by deep models with tree-based models. Ultimately, our highest performing model achieves an area under the precision-recall curve of 0.49 and an area under the ROC curve of 0.87.
研究の動機と目的
- ソフトウェアのスケーラブルな脆弱性検出の必要性を動機づけ、解決する。
- 静的解析ツールでラベル付けされた大規模なオープンソースコードデータセットを活用してMLモデルを訓練する。
- 脆弱性検出のためのソースベースとビルドベースの特徴を比較する。
- 伝統的なモデルと深層学習モデルを評価し、性能向上のためのモデル融合を検討する。
提案手法
- 二つの特徴パイプラインを構築する。 (1) コンパイル中に抽出される CFG、use-def、op-vec からのビルドベース特徴、 (2) カスタム C/C++ レクサー、Bag-of-Words、word2vec 埋め込みを用いたソースベースのトークン特徴。
- Clang 静的解析の出力から得られる関数レベルのラベルを用い、 buggy 対 good をグラウンドトゥルースとして複数の分類器を訓練する。
- ソースベースモデルを三つ評価する。 Bag-of-Words(BoW)特徴を用いた Extra Trees、word2vec 初期化の TextCNN、TextCNN の特徴を Extra Trees に入力、また固定サイズのビルド特徴ベクトル上でのビルドベース Random Forest と比較する。
- ビルドベースの特徴とソースベースの BoW特徴を連結して結合モデルを調査する。
- データセットとして Debian と GitHub の二つを使用し、評価の妥当性を確保するため厳格な重複除去を実施する。
実験結果
リサーチクエスチョン
- RQ1脆弱性検出はソースコードパターンだけから効果的に学習できるか、それともビルド由来の特徴が補完情報を提供するか。
- RQ2深層学習表現(word2vec、TextCNN)はこのタスクで従来モデルより優れており、モデル融合は性能を向上させるか。
- RQ3Debian と GitHub のように特徴が異なるデータセット間で、ソースベースとビルドベースのアプローチはどのように比較されるか。
主な発見
- ソースベースのモデルは ROC AUC においてデータセットをまたいでビルドベースのモデルよりも優れている。
- 最良のソースベースモデル(TextCNN の特徴を Extra Trees に投入)は、結合データセット Debian+Github で ROC AUC 0.87 および PR AUC 0.49 を達成。
- BoW+ET は同じデータセットで ROC AUC 0.85 および PR AUC 0.44、word2vec+CNN は ROC AUC 0.87 および PR AUC 0.45、CNN 特徴量 + ET は ROC AUC 0.87 および PR AUC 0.49 を達成。
- ビルドベースの検出では Debian が ROC AUC 0.76、PR AUC 0.21、GitHub が ROC AUC 0.74、PR AUC 0.22。
- 結合モデル(ビルド+ソース)は一般に個別ソースより優れており、例えば GitHub では Build 0.74/0.22、Source 0.81/0.29、Combined 0.82/0.32 の値を示す。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。