Skip to main content
QUICK REVIEW

[논문 리뷰] How well does LLM generate security tests?

Ying Zhang, Wenjia Song|arXiv (Cornell University)|2023. 10. 01.
Web Application Security Vulnerabilities인용 수 12
한 줄 요약

본 연구는 ChatGPT-4.0을 사용하여 취약한 라이브러리를 가진 앱의 보안 테스트에 대한 증명 개념(PoC)을 생성하고, 55개 작업에서 24개의 exploitable 테스트를 제시하며 SIEGE와 TRANSFER를 능가함.

ABSTRACT

Developers often build software on top of third-party libraries (Libs) to improve programmer productivity and software quality. The libraries may contain vulnerabilities exploitable by hackers to attack the applications (Apps) built on top of them. People refer to such attacks as supply chain attacks, the documented number of which has increased 742% in 2022. People created tools to mitigate such attacks, by scanning the library dependencies of Apps, identifying the usage of vulnerable library versions, and suggesting secure alternatives to vulnerable dependencies. However, recent studies show that many developers do not trust the reports by these tools; they ask for code or evidence to demonstrate how library vulnerabilities lead to security exploits, in order to assess vulnerability severity and modification necessity. Unfortunately, manually crafting demos of application-specific attacks is challenging and time-consuming, and there is insufficient tool support to automate that procedure. In this study, we used ChatGPT-4.0 to generate security tests, and to demonstrate how vulnerable library dependencies facilitate the supply chain attacks to given Apps. We explored various prompt styles/templates, and found that ChatGPT-4.0 generated tests for all 55 Apps, demonstrating 24 attacks successfully. It outperformed two state-of-the-art security test generators -- TRANSFER and SIEGE -- by generating a lot more tests and achieving more exploits. ChatGPT-4.0 worked better when prompts described more on the vulnerabilities, possible exploits, and code context. Our research will shed light on new research in security test generation. The generated tests will help developers create secure by design and secure by default software.

연구 동기 및 목표

  • 공급망 공격의 완화를 촉진하기 위해 라이브러리의 취약점이 종속 앱으로 어떻게 확산되는지 시연한다.
  • 대형 언어 모델이 실행 가능한 보안 테스트를 생성하여 공격 경로를 설명할 수 있는지 평가한다.
  • LLM이 생성한 테스트를 최신의 보안 테스트 생성 도구와 비교하여 효과성과 실용성을 평가한다.

제안 방법

  • App가 취약한 라이브러리 버전에 의존하는 55 4 App-Lib 쌍의 데이터세트를 구성한다.
  • 모범 사례를 모방하는 보안 테스트를 생성하기 위해 ChatGPT(Default 및 Variants)에 대한 여러 프롬프트를 설계한다.
  • 단계별 평가: 생성된 테스트를 App에 통합하고 컴파일한 뒤 테스트를 실행하여 동작 및 익스플로잇을 검증한다.
  • 결과를 평가하기 위해 세 가지 지표(App-Lib 테스트 적용 가능성, 테스트 컴파일 가능성, 실제 취약점 익스플로잇) 사용.
  • 同一 데이터세트에서 ChatGPT의 결과를 두 도구(SIEGE 및 TRANSFER)와 비교한다.
  • 프롬프트의 정보 요소 중 결과에 가장 큰 영향을 주는 요소를 파악하고 성공/실패 요인을 분석한다.
Figure 1. Our default usage of ChatGPT to generate security tests
Figure 1. Our default usage of ChatGPT to generate security tests

실험 결과

연구 질문

  • RQ1RQ1: ChatGPT가 취약한 Libs를 가진 앱에 대해 보안 테스트를 얼마나 효과적으로 생성하는가?
  • RQ2RQ2: 프롬프트 설계(포함되는 정보)가 테스트 생성에서 ChatGPT의 성능에 어떤 영향을 미치는가?
  • RQ3RQ3: ChatGPT의 성능이 기존 보안 테스트 생성 도구(SIEGE, TRANSFER)와 어떻게 비교되는가?

주요 결과

  • ChatGPT는 55개의 프롬프트 모두에 대해 테스트를 생성했고; 26개는 컴파일 가능하고 실행 가능했으며, 14개는 경미한 수정 후 컴파일 가능해져 총 40개의 컴파일 가능한 테스트가 된다.
  • 생성된 컴파일 가능 테스트 중 24개가 알려진 취약점을 성공적으로 익스플로잇하여 PoC(증명 개념 익스플로잇)를 입증했다.
  • ChatGPT는 데이터세트 55개의 앱에서 TRANSFER를 능가하여 4개의 취약점을 익스플로잇했고 SIEGE는 익스플로잇에 실패했다.
  • Lib에서 취약점별 테스트가 없으면 생성된 테스트 중 어느 것도 취약점을 익스플로잇할 수 없으므로, 프롬프트에서 취약점 맥락의 상세한 정보가 중요하다.
  • 취약점, 익스플로잇, 코드 맥락에 대한 더 설명적인 정보를 포함한 프롬프트가 성능을 향상시켰으며, 특히 취약점 테스트 요소가 결정적이었다.
  • 일部 생성된 테스트가 컴파일되지 못한 경우가 있었으며(55개 중 15개), 이는 도구 모의(Mock)나 누락/오류 프로그램 엔터티로 인한 한계임을 시사한다.
Figure 2. Our prompt template
Figure 2. Our prompt template

더 나은 연구,지금 바로 시작하세요

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.