Skip to main content
QUICK REVIEW

[논문 리뷰] Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?

Owura Asare, Meiyappan Nagappan|arXiv (Cornell University)|2022. 04. 10.
Software Engineering Research인용 수 13
한 줄 요약

이 연구는 실제 C/C++ 프로젝트에서 이전에 취약성으로 이어진 코드 조각을 프롬프트로 사용하여 GitHub Copilot이 인간 개발자와 유사한 비율로 소프트웨어 취약성을 유발하는지 평가한다. Big-Vul 데이터셋을 사용하여 저자들은 Copilot이 취약한 코드를 33%의 비율로 재생산하고, 수정된 코드를 25%의 비율로 재생산함을 발견하였다—이는 인간보다 취약성을 유발하는 경향이 덜하다는 것을 시사하지만, 여전히 상당수의 경우에서 불안정한 코드를 생성한다는 점에서 보안 위험이 존재함을 시사한다.

ABSTRACT

Several advances in deep learning have been successfully applied to the software development process. Of recent interest is the use of neural language models to build tools, such as Copilot, that assist in writing code. In this paper we perform a comparative empirical analysis of Copilot-generated code from a security perspective. The aim of this study is to determine if Copilot is as bad as human developers. We investigate whether Copilot is just as likely to introduce the same software vulnerabilities as human developers. Using a dataset of C/C++ vulnerabilities, we prompt Copilot to generate suggestions in scenarios that led to the introduction of vulnerabilities by human developers. The suggestions are inspected and categorized in a 2-stage process based on whether the original vulnerability or fix is reintroduced. We find that Copilot replicates the original vulnerable code about 33% of the time while replicating the fixed code at a 25% rate. However this behaviour is not consistent: Copilot is more likely to introduce some types of vulnerabilities than others and is also more likely to generate vulnerable code in response to prompts that correspond to older vulnerabilities. Overall, given that in a significant number of cases it did not replicate the vulnerabilities previously introduced by human developers, we conclude that Copilot, despite performing differently across various vulnerability types, is not as bad as human developers at introducing vulnerabilities in code.

연구 동기 및 목표

  • GitHub Copilot이 인간 개발자와 유사한 비율로 소프트웨어 취약성을 유발하는지 평가하는 것.
  • Big-Vul 데이터셋에서 실제 인간에 의해 발생한 취약성과 비교하여 Copilot이 취약하거나 수정된 코드를 생성하는 방식을 분석하는 것.
  • Copilot의 취약성 유발 비율이 취약성 유형, 연령 또는 수정 복잡도에 따라 달라지는지 조사하는 것.
  • Copilot의 행동이 보안 소프트웨어 개발 및 향후 AI 기반 프로그래밍 도구에 미치는 영향을 평가하는 것.

제안 방법

  • 연구는 실제 C/C++ 취약성과 관련된 취약한 코드 커밋 및 수정된 코드 커밋을 포함한 Big-Vul 데이터셋을 사용한다.
  • 각 취약성에 대해, 연구자들은 취약성이 유발되기 전의 코드 조각을 추출하고 이를 Copilot의 프롬프트로 사용한다.
  • Copilot의 생성된 제안은 두 단계 분류 과정을 거친다: 원래의 취약한 코드 또는 수정된 코드와 일치하는지 여부.
  • 보안적 동등성 기준에 따라 출력물의 수동 검토 및 분류가 수행된다.
  • 연구는 다양한 취약성 유형(CWE 카테고리), 게시 일자, 수정 복잡도에 따라 Copilot의 행동 변화를 분석한다.
  • 통계적 분석을 통해 데이터셋의 다양한 서브셋에서 취약성 재생산 및 수정 생성의 추세를 평가한다.

실험 결과

연구 질문

  • RQ1GitHub Copilot은 인간 개발자만큼 동일한 취약성을 코드에 유도할 가능성이 높은가?
  • RQ2Copilot이 취약한 코드나 수정된 코드를 생성하는 경향은 취약성의 연령에 따라 달라지는가?
  • RQ3특정 유형의 취약성이 Copilot에 의해 더 자주 재생산되거나 수정되는가?
  • RQ4수정의 복잡도는 Copilot이 올바른 보안 버전을 생성하는 능력에 어떤 영향을 미치는가?

주요 결과

  • Copilot은 테스트 케이스의 약 33%에서 원래의 취약한 코드를 재생산하여, 인간 개발자만큼 같은 취약성을 유도하는 경향이 적다는 것을 시사한다.
  • Copilot은 25%의 경우에서 해당 취약성에 대한 올바른 수정을 생성하여, 일부 상황에서는 알려진된 취약성을 피할 수 있음을 시사한다.
  • 최근에 유발된 취약성에 대해서는 Copilot이 취약한 코드를 더 적게 생성하는 경향이 있어, 최근의 보안 문제에 대해 성능이 향상됨을 보여준다.
  • 수정이 단순한 취약성에 대해서는 Copilot의 성능이 더 뛰어나, 수정 복잡도와 생성 정확도 사이에 상관관계가 있음을 시사한다.
  • Copilot이 취약성을 재생산하거나 수정을 생성할 확률은 CWE 카테고리에 따라 크게 달라지며, 일부 취약성 유형은 다른 유형보다 더 자주 복제되는 경향이 있다.
  • 일부 경우에서 인간보다 성능이 향상되었음에도 불구하고, Copilot은 평가된 시나리오의 최소 1/3 이상에서 여전히 불안정한 코드를 유도하여 지속적인 보안 위험이 있음을 시사한다.

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

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

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

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