Skip to main content
QUICK REVIEW

[논문 리뷰] Vulnerability Mimicking Mutants

Aayush Garg, Renzo Degiovanni|arXiv (Cornell University)|2023. 03. 07.
Software Engineering ResearchComputer Science인용 수 3
한 줄 요약

이 논문은 CodeBERT와 같은 사전 훈련된 언어 모델이 생성한 코드 변종 중 실제 보안 취약점의 동작을 의미적으로 재현하는 '취약점 모방 변종'을 식별하는 기계학습 기반 접근법인 VMMS를 소개한다. 전체 변종의 3.9%에 불과하지만, 이들 취약점 모방 변종은 분석한 45개의 취약점 중 55.6%의 실패 행동을 성공적으로 재현하며, VMMS는 0.63의 MCC, 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.

연구 동기 및 목표

  • 언어 모델 기반 변종 테스팅 도구가 실제 보안 취약점의 의미적 특성을 재현하는 변종을 생성할 수 있는지 조사하기 위해.
  • 실행 이전에 분석 대상이 되는 변종의 최소 집합을 식별하여 모든 변종을 분석하는 데 드는 높은 비용을 해결하기 위해.
  • 수동 특성 공학 없이도 취약점 모방 변종을 정적 기반 기계학습 방법으로 예측할 수 있는 방법을 개발하기 위해.
  • 실제 취약점과 동일한 테스트에서 실패하는 변종을 식별함으로써 이러한 예측의 효과성을 평가하기 위해 (취약성 증명, Proof of Vulnerability).

제안 방법

  • 연구는 μ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는 0.63의 Matthews 상관계수(MCC)를 기록하여 중간에서 강한 예측 성능을 보인다.
  • 정밀도가 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

이 논문 읽기

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

누빈트에서 이 논문 읽기

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