Skip to main content
QUICK REVIEW

[논문 리뷰] ACFIX: Guiding LLMs with Mined Common RBAC Practices for Context-Aware Repair of Access Control Vulnerabilities in Smart Contracts

Lyuye Zhang, Kaixuan Li|arXiv (Cornell University)|2024. 03. 11.
Blockchain Technology Applications and Security인용 수 5
한 줄 요약

ACFIX는 채굴된 RBAC 분류 체계와 컨텍스트 인식 프롬프트를 GPT-4와 함께 활용하여 스마트 계약의 접근 제어 취약점을 수정하고, baseline GPT-4 대비 상당한 개선을 달성하며 인간에 맞춘 패치를 가능하게 한다.

ABSTRACT

Smart contracts are susceptible to various security issues, among which access control (AC) vulnerabilities are particularly critical. While existing research has proposed multiple detection tools, the automatic and appropriate repair of AC vulnerabilities in smart contracts remains a challenge. Unlike commonly supported vulnerability types by existing repair tools, such as reentrancy, which are usually fixed by template-based approaches, the main obstacle of AC lies in identifying the appropriate roles or permissions amid a long list of non-AC-related source code to generate proper patch code, a task that demands human-level intelligence. Leveraging recent advancements in large language models (LLMs), we employ the state-of-the-art GPT-4 model and enhance it with a novel approach called ACFIX. The key insight is that we can mine common AC practices for major categories of code functionality and use them to guide LLMs in fixing code with similar functionality. To this end, ACFIX involves both offline and online phases. First, during the offline phase, ACFIX mines a taxonomy of common Role-based Access Control (RBAC) practices from 344,251 on-chain contracts, categorizing 49 role-permission pairs from the top 1,000 pairs mined. Second, during the online phase, ACFIX tracks AC-related elements across the contract and uses this context information along with a Chain-of-Thought pipeline to guide LLMs in identifying the most appropriate role-permission pair for the subject contract and subsequently generating a suitable patch. This patch will then undergo a validity and effectiveness check. To evaluate ACFIX, we built the first benchmark dataset of 118 real-world AC vulnerabilities, and our evaluation revealed that ACFIX successfully repaired 94.92% of them. This represents a significant improvement compared to the baseline GPT-4, which achieved only 52.54%.

연구 동기 및 목표

  • 현실 세계의 스마트 계약에서 일반적인 RBAC (Role-Based Access Control) 관행을 식별하고 동적 RBAC 분류 체계를 구축한다.
  • 정적 코드 분석을 활용하여 패치 생성을 안내하는 AC 컨텍스트 그래프를 구성한다.
  • RBAC 분류 체계와 컨텍스트 그래프를 사용해 GPT-4를 안내하여 AC 취약점에 대한 올바른 패치를 생성한다.
  • RBAC 정책과의 정합성을 보장하고 회귀를 방지하기 위해 전담 유효성 검사기로 패치를 검증한다.
  • 최신 도구와 비교하여 ACFIX를 벤치마크하고 인간 수리와의 정합성을 평가한다.

제안 방법

  • 344,251 건의 온체인 계약에서 RBAC 관행을 오프라인으로 채굴하여 49개 역할-권한 쌍의 분류 체계를 구축한다.
  • 취약 함수 주변에 AC 컨텍스트 그래프(ACG)를 구성하기 위한 정적 슬라이싱.
  • 온라인 이중 에이전트(생성기 및 유효성 검사기) MAD 프레임워크가 LLM이 적절한 역할-권한 쌍을 선택하고 패치를 생성하도록 안내한다(CoT 프롬 prompting).
  • 패치는 정적으로 검사되고 RBAC 일관성과 의미적 정확성을 보장하기 위해 유효성 검사기에 의해 반복적으로 검증된다.
  • 실제 AC 취약점 벤치마크 118건에 대한 평가에서 ACFIX가 94.92%의 수리율을 보였고 GPT-4 baseline은 52.54%였다.
  • 상태-오브-더-아트(SOTA) 수리 도구와의 비교 및 맥락과 분류 체계의 기여를 평가하는 소거 연구.

실험 결과

연구 질문

  • RQ1채굴된 RBAC 패턴이 LLM이 스마트 계약의 AC 취약점을 수리하도록 효과적으로 안내할 수 있는가?
  • RQ2AC 컨텍스트 그래프와 RBAC 분류 체계를 포함하는 것이 일반 LLM 수리보다 패치 정확도와 의미적 정합성을 향상시키는가?
  • RQ3현실 세계의 AC 사례에서 ACFIX가 baseline GPT-4 및 다른 SOTA 취약점 수리 도구에 비해 어떤 성능을 보이는가?
  • RQ4MAD 프레임워크의 유효성 검사기가 수리 성공 및 품질에 미치는 영향은 무엇인가?

주요 결과

  • ACFIX는 벤치마크에서 AC 취약점의 94.92%를 수리했고 GPT-4 baseline의 52.54%에 비해 현저히 높다.
  • 소거 연구는 맥락과 분류 체계를 풍부하게 하는 것이 수리 효과를 향상시킴을 보여준다(GPT-4 단독은 52.54%를 고쳤다).
  • 유효성 검사기 구성 요소가 수리 효과를 87.28%에서 94.92%로 상승시켰다.
  • 인간 전문가들은 대체로 ACFIX 수리와 일치하고 때때로 공개 이슈에서 더 나은 성과를 보이지만, 많은 수정은 인간 단독으로는 비정형적이다.
  • RBAC 분류 체계는 49개의 역할-권한 쌍을 포착하여 온체인 계약에서 관찰된 일반적인 AC 관행의 대다수를 커버한다.

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

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

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

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