Skip to main content
QUICK REVIEW

[論文レビュー] Stateful Greybox Fuzzing

Jinsheng Ba, Marcel Böhme|arXiv (Cornell University)|Apr 6, 2022
Software Testing and Debugging TechniquesComputer Science被引用数 18
ひとこと要約

本稿では、enum型の状態変数を用いて動的State Transition Tree (STT)を構築することで、プロトコル実装内の状態変数を自動的に特定・追跡するステートフルなグレイボックスファズァー、SGFuzzを提案する。実行時インストルメンテーションを活用して状態遷移を記録し、未探索の状態を向けるようにファジングを誘導することで、ベースラインのグレイボックスファズァーと比較して、ステートフルバグの発見速度を2倍に向上させ、33倍の状態遷移シーケンスを達成し、コードカバレッジの向上速度も2倍となった。

ABSTRACT

Many protocol implementations are reactive systems, where the protocol process is in continuous interaction with other processes and the environment. If a bug can be exposed only in a certain state, a fuzzer needs to provide a specific sequence of events as inputs that would take protocol into this state before the bug is manifested. We call these bugs as "stateful" bugs. Usually, when we are testing a protocol implementation, we do not have a detailed formal specification of the protocol to rely upon. Without knowledge of the protocol, it is inherently difficult for a fuzzer to discover such stateful bugs. A key challenge then is to cover the state space without an explicit specification of the protocol. In this work, we posit that manual annotations for state identification can be avoided for stateful protocol fuzzing. Specifically, we rely on a programmatic intuition that the state variables used in protocol implementations often appear in enum type variables whose values (the state names) come from named constants. In our analysis of the Top-50 most widely used open-source protocol implementations, we found that every implementation uses state variables that are assigned named constants (with easy to comprehend names such as INIT, READY) to represent the current state. In this work, we propose to automatically identify such state variables and track the sequence of values assigned to them during fuzzing to produce a "map" of the explored state space. Our experiments confirm that our stateful fuzzer discovers stateful bugs twice as fast as the baseline greybox fuzzer that we extended. Starting from the initial state, our fuzzer exercises one order of magnitude more state/transition sequences and covers code two times faster than the baseline fuzzer. Several zero-day bugs in prominent protocol implementations were found by our fuzzer, and 8 CVEs have been assigned.

研究の動機と目的

  • 特定の入力シーケンスの後でのみ現れる状態依存バグを発見する課題に対処すること。
  • プログラムの状態に気づかない従来のカバレッジ指向グレイボックスファジングの限界を克服し、複雑な状態空間を効果的にナビゲートできること。
  • ファジングにおける状態同定に、手動でのプロトコル仕様書や人為的メタデータに依存しないこと。
  • 反応型プロトコルシステムの未知の状態空間を効率的に探索・マッピングする自動的手法を開発すること。
  • 動的に構築されたState Transition Tree (STT) を用いて、未探索の状態遷移を優先するように入力生成を誘導することで、ファジングの効率を向上させること。

提案手法

  • 実行時にenum型の状態変数への代入を検出するため、プロトコルバイナリをインストルメントし、状態遷移を特定する。
  • すべてのファジング実行にわたる状態変数値のシーケンスを記録する、グローバルでメモリ上のState Transition Tree (STT) を構築する。
  • STTを用いてファジングを誘導し、訪問頻度が低い状態やSTT内の新しいブランチを向けるシードを優先する。
  • STT内の新しいノードをトリガーする入力をシードコーパスに追加することで、コードカバレッジを超えた状態空間カバレッジを向上させる。
  • STTフィードバックをファイザーの変異戦略に統合し、未知の状態遷移を探索する可能性を高める。
  • 既存のグレイボックスファジングインfra(例:LibFuzzer)を活用し、状態認識フィードバックを追加することで、効率的な状態空間ナビゲーションを可能にする。

実験結果

リサーチクエスチョン

  • RQ1プロトコル実装内の状態変数を、プロトコル仕様書や手動アノテーションなしに自動的に検出し、状態空間をマッピングするために使用可能か?
  • RQ2実行時において動的に構築されるState Transition Tree (STT) は、未知のプロトコル実装の状態空間を効果的に表現し、探索を誘導できるか?
  • RQ3STTからの状態認識フィードバックは、従来のカバレッジ指向アプローチと比較して、グレイボックスファジングの効率を向上させるか?
  • RQ4STT誘導ファジングは、ファジング中に探索される状態遷移シーケンスの多様性と深さをどの程度向上させるか?
  • RQ5STT誘導ファジングは、既存のツールと比較して、実世界のプロトコル実装におけるゼロデイバグをより効果的に発見できるか?

主な発見

  • SGFuzzは、元のベースライングレイボックスファズァーであるLibFuzzerと比較して、ステートフルバグの発見速度を約2倍に向上させた。
  • SGFuzzは、同じ時間枠でLibFuzzerと比較して33倍、IJONと比較して15倍、AFLNetと比較して260倍の状態遷移シーケンスを達成した。
  • SGFuzzは、LibFuzzerと同等のブランチカバレッジに到達するまでの時間が約2倍速く、コードカバレッジ効率の向上を示した。
  • ファイザーは、広く使われているプロトコル実装において12件の新たなゼロデイ脆弱性を発見し、そのうち8件がCVEに割り当てられた。
  • 研究対象の上位50件のオープンソースプロトコル実装すべてにおいて、STT構築が有効であったことから、enumベースの状態変数の広範な存在が確認された。
  • SGFuzzの状態認識誘導は、AFLNet や IJON といった最先端のツールと比較して、複雑なマルチステッププロトコル動作の探索において顕著に優れていた。

この論文を読む

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

Nubintでこの論文を読む

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