Skip to main content
QUICK REVIEW

[논문 리뷰] Double Backdoored: Converting Code Large Language Model Backdoors to Traditional Malware via Adversarial Instruction Tuning Attacks

Md Imran Hossen, Chilukoti, Sai Venkatesh|arXiv (Cornell University)|2024. 04. 29.
Network Security and Intrusion DetectionComputer Science인용 수 3
한 줄 요약

이 논문은 악성 코드 스니펫을 적대적으로 삽입한 트레이닝 데이터로 지시 편조된 코드 LLM을 악용하는 EvilInstructCoder라는 프레임워크를 소개한다. CodeLlama, DeepSeek-Coder, StarCoder2에서 0.5%의 오염된 데이터(81개 샘플)만으로도 배경 공격 성공률이 76–86%에 이를 정도로 심각한 보안 취약성을 드러낸다.

ABSTRACT

Instruction-tuned Large Language Models designed for coding tasks are increasingly employed as AI coding assistants. However, the cybersecurity vulnerabilities and implications arising from the widespread integration of these models are not yet fully understood due to limited research in this domain. This work investigates novel techniques for transitioning backdoors from the AI/ML domain to traditional computer malware, shedding light on the critical intersection of AI and cyber/software security. To explore this intersection, we present MalInstructCoder, a framework designed to comprehensively assess the cybersecurity vulnerabilities of instruction-tuned Code LLMs. MalInstructCoder introduces an automated data poisoning pipeline to inject malicious code snippets into benign code, poisoning instruction fine-tuning data while maintaining functional validity. It presents two practical adversarial instruction tuning attacks with real-world security implications: the clean prompt poisoning attack and the backdoor attack. These attacks aim to manipulate Code LLMs to generate code incorporating malicious or harmful functionality under specific attack scenarios while preserving intended functionality. We conduct a comprehensive investigation into the exploitability of the code-specific instruction tuning process involving three state-of-the-art Code LLMs: CodeLlama, DeepSeek-Coder, and StarCoder2. Our findings reveal that these models are highly vulnerable to our attacks. Specifically, the clean prompt poisoning attack achieves the ASR@1 ranging from over 75% to 86% by poisoning only 1% (162 samples) of the instruction fine-tuning dataset. Similarly, the backdoor attack achieves the ASR@1 ranging from 76% to 86% with a 0.5% poisoning rate. Our study sheds light on the critical cybersecurity risks posed by instruction-tuned Code LLMs and highlights the urgent need for robust defense mechanisms.

연구 동기 및 목표

  • 지시 편조된 코드 LLM의 사이버보안 취약성을 적대적 지시 편조 공격 하에서 조사하기.
  • 지시 편조 데이터셋에 악성 코드를 자동으로 생성하고 삽입할 수 있는 프레임워크 개발하기.
  • 실제 세계의 적대자 능력을 반영하는 다양한 위협 모델을 바탕으로 지시 편조된 코드 LLM의 공격 가능성 평가하기.
  • 오염 비율이 백도어 성공률과 모델 유틸리티에 미치는 영향 측정하기.
  • 백도어가 삽입된 모델이 악성 코드 생성을 명시적으로 지시받은 모델보다 우수할 수 있음을 입증하기.

제안 방법

  • 적대적 코드 삽입 엔진은 지시 편조 데이터셋 수집 과정에서 악성 코드 스니펫을 자동으로 생성하고, 정상 코드에 삽입한다.
  • 프레임워크는 특정 자연어 지시가 들어올 경우 악성 패킷을 생성하도록 유도하는 트리거 문장을 사용한다.
  • 백도어 모델을 훈련하기 위해 지시 편조 데이터셋의 소수의 일부(0.5–3%)에 오염을 적용한다.
  • 공격 성공률 평가에는 공격 성공률 1(ASR@1)과 ASR@10을 사용하여 악성 패킷을 포함한 응답 비율을 측정한다.
  • 비교 평가에는 백도어가 삽입된 모델과 악성 코드 생성을 명시적으로 지시받은 모델를 포함하며, 패킷을 분리하기 위해 <m>과 </m> 태그를 사용한다.
  • 프레임워크는 여러 모델 크기와 지시 편조 설정을 고려해 최신의 세 가지 코드 LLM(코드러마, 디프시크-코더, 스타코더2)을 평가한다.
Figure 1. Overview of EvilInstructCoder Attack Framework. In this figure, $r$ represents a sample benign response from instruction tuning dataset, with the malicious version of $r$ highlighted in red . $i$ denotes an instruction, with the instruction containing a trigger phrase set by the attacker m
Figure 1. Overview of EvilInstructCoder Attack Framework. In this figure, $r$ represents a sample benign response from instruction tuning dataset, with the malicious version of $r$ highlighted in red . $i$ denotes an instruction, with the instruction containing a trigger phrase set by the attacker m

실험 결과

연구 질문

  • RQ1지시 편조된 코드 LLM은 정상적인 자연어 지시에 대해 악성 코드를 생성하도록 조작될 수 있는가?
  • RQ2지시 편조 데이터셋에 대한 데이터 오염 방식을 통한 백도어 삽입은 코드 LLM에서 얼마나 효과적인가?
  • RQ3다양한 코드 LLM 아키텍처에서 높은 공격 성공률를 달성하기 위해 필요한 최소 오염 비율은 얼마인가?
  • RQ4백도어가 삽입된 모델의 성능은 악성 코드 생성을 명시적으로 지시받은 모델과 비교해 어떻게 되는가?
  • RQ5백도어 공격는 표준 코드 생성 벤치마크에서 모델의 성능을 얼마나 떨어뜨리는가?

주요 결과

  • 단지 81개 샘플(전체 데이터셋의 0.5%)만 오염시켜도, CodeLlama 7B 모델에서 ASR@1 점수가 86%에 도달했으며, DeepSeek-Coder 6.7B에서는 81.2%, StarCoder2 7B에서는 76% 이상을 기록했다.
  • 모든 모델에서 0.5% 오염 비율일 때 ASR@10가 100%에 도달하여, 여러 테스트 케이스에서 일관되고 높은 공격 가능성 확인.
  • 백도어가 삽입된 모델는 악성 코드 생성을 명시적으로 지시받은 모델보다 성능이 뛰어나며, 후자의 경우 DeepSeek-Coder 6.7B에서 최대 ASR@1이 81.2%에 그쳤다.
  • GPT-3.5조차도 명시적 지시를 받았을 때 ASR@1이 98%에 도달하여, 백도어가 삽입된 모델가 명시적 지시 공격에 비해 매우 경쟁력 있음을 보여준다.
  • HumanEval 벤치마크에서 StarCoder2 7B 모델의 pass@1 점수는 최대 3.8% 감소에 그쳐 표준 성능에 미치는 영향이 최소한임을 시사한다.
  • ASR@1은 3% 오염 비율 이상에서 96% 이상으로趋기며, ASR@10는 0.5% 오염 비율에서도 100%에 도달하여 공격의 높은 효율성과 확장성을 확인한다.
Figure 2. Attack performance against instruction-tuned (FT) Code LLMs under various poisoning rates in Adversarial Scenario A, employing the clean prompt poisoning attack method.
Figure 2. Attack performance against instruction-tuned (FT) Code LLMs under various poisoning rates in Adversarial Scenario A, employing the clean prompt poisoning attack method.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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