Skip to main content
QUICK REVIEW

[논문 리뷰] Stateful Greybox Fuzzing

Jinsheng Ba, Marcel Böhme|arXiv (Cornell University)|2022. 04. 06.
Software Testing and Debugging TechniquesComputer Science인용 수 18
한 줄 요약

이 논문은 enum 유형의 상태 변수를 사용하여 프로토콜 구현에서 상태 변수를 자동으로 식별하고 추적하는 상태 기반 회색상자 퍼저(SGFuzz)를 제안한다. 이를 통해 동적 상태 전이 트리(STT)를 구성한다. 런타임 인스트루멘테이션을 활용해 상태 전이를 기록하고, 탐색되지 않은 상태를 향해 퍼저링을 이끌어내어, 기준 회색상자 퍼저보다 상태 기반 버그를 두 배 빠르게 발견한다. 이로써 상태 전이 시퀀스는 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.

연구 동기 및 목표

  • 특정 입력 시퀀스 이후에만 나타나는 상태 기반 버그를 발견하는 데 도전하는 것.
  • 프로그램 상태에 대한 인식이 없고 복잡한 상태 공간을 탐색할 수 없는 기존의 커버리지 기반 회색상자 퍼저링의 한계를 극복하는 것.
  • 퍼저링에서 상태 식별을 위한 수동 프로토콜 사양 또는 인간의 주석에 의존하지 않는 것.
  • 반응형 프로토콜 시스템의 알려지지 않은 상태 공간을 탐색하고 매핑하기 위한 효율적이고 자동화된 방법을 개발하는 것.
  • 동적으로 구성된 상태 전이 트리(STT)를 사용해 미탐색된 상태 전이로 향하는 입력 생성을 이끌어내어 퍼저링의 효율성을 향상시키는 것.

제안 방법

  • 런타임에 enum 유형의 상태 변수에 대한 할당을 감지하여 프로토콜 바이너리에 인스트루멘테이션을 적용하고, 상태 전이를 식별한다.
  • 모든 퍼저링 실행 동안 상태 변수 값의 시퀀스를 기록하는 글로벌 메모리 기반 상태 전이 트리(STT)를 구성한다.
  • STT를 사용해 퍼저링을 이끌어내며, 드문 상태나 STT 내 새로운 브랜치로 향하는 시드를 우선순위에 올린다.
  • STT에서 새로운 노드를 트리거하는 입력을 시드 코퍼스에 추가하여, 코드 커버리지만으로는 달성할 수 없는 상태 공간 커버리지의 향상을 이룬다.
  • STT 피드백을 퍼저링의 변형 전략에 통합하여 새로운 상태 전이를 탐색할 확률을 높인다.
  • 기존의 회색상자 퍼저링 인fra구처(예: LibFuzzer)를 활용하고, 상태 인식 피드백을 추가하여 효율적인 상태 공간 탐색을 가능하게 한다.

실험 결과

연구 질문

  • RQ1프로토콜 사양이나 수동 주석 없이도 프로토콜 구현에서 상태 변수를 자동으로 탐지하고 상태 공간을 매핑하는 데 사용할 수 있는가?
  • RQ2런타임에 동적으로 구성된 상태 전이 트리(STT)는 알려지지 않은 프로토콜 구현의 상태 공간을 효과적으로 표현하고 탐색을 이끌 수 있는가?
  • RQ3STT로부터의 상태 인식 피드백은 기존의 커버리지 기반 접근 방식에 비해 상태 기반 버그 탐지의 효율성을 향상시키는가?
  • RQ4STT 기반 퍼저링은 퍼저링 동안 탐색하는 상태 전이 시퀀스의 다양성과 깊이를 어느 정도 증가시키는가?
  • RQ5STT 기반 퍼저링은 기존 도구에 비해 실제 프로토콜 구현에서 0-day 버그를 더 효과적으로 발견할 수 있는가?

주요 결과

  • SGFuzz는 기반 회색상자 퍼저인 LibFuzzer보다 상태 기반 버그를 약 두 배 빠르게 발견했다.
  • SGFuzz는 동일한 시간 프레임 내에서 LibFuzzer보다 33배, IJON보다 15배, AFLNet보다 260배 더 많은 상태 전이 시퀀스를 확보했다.
  • SGFuzz는 LibFuzzer보다 약 두 배 빠르게 동일한 분기 커버리지 수준에 도달하여 코드 커버리지 효율성이 향상됨을 입증했다.
  • 퍼저는 널리 사용되는 프로토콜 구현에서 12개의 새로운 0-day 취약점을 발견했으며, 그 중 8개는 CVE에 할당되었다.
  • 연구한 50개의 최상위 오픈소스 프로토콜 구현 전반에서 STT 구축이 효과적이었으며, 이는 enum 기반 상태 변수의 광범위한 존재를 확인한다.
  • SGFuzz의 상태 인식 가이던스는 복잡한 다단계 프로토콜 동작을 탐색하는 데 있어 최신 기술 수준의 도구들인 AFLNet과 IJON보다 뚜렷한 우수성을 보였다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.