[논문 리뷰] Stealthy Backdoor Attack for Code Models
Afraidoor는 코드 모델에 대한 은밀한 백도어 공격으로, 트리거를 주입하기 위한 적응적 적대적 토큰 재명명을 사용합니다. CodeBERT, PLBART, CodeT5에 대해 코드 요약과 방법 명 예측에서 평가되었으며, 방어는 부분적으로 효과가 없었습니다.
Code models, such as CodeBERT and CodeT5, offer general-purpose representations of code and play a vital role in supporting downstream automated software engineering tasks. Most recently, code models were revealed to be vulnerable to backdoor attacks. A code model that is backdoor-attacked can behave normally on clean examples but will produce pre-defined malicious outputs on examples injected with triggers that activate the backdoors. Existing backdoor attacks on code models use unstealthy and easy-to-detect triggers. This paper aims to investigate the vulnerability of code models with stealthy backdoor attacks. To this end, we propose AFRAIDOOR (Adversarial Feature as Adaptive Backdoor). AFRAIDOOR achieves stealthiness by leveraging adversarial perturbations to inject adaptive triggers into different inputs. We evaluate AFRAIDOOR on three widely adopted code models (CodeBERT, PLBART and CodeT5) and two downstream tasks (code summarization and method name prediction). We find that around 85% of adaptive triggers in AFRAIDOOR bypass the detection in the defense process. By contrast, only less than 12% of the triggers from previous work bypass the defense. When the defense method is not applied, both AFRAIDOOR and baselines have almost perfect attack success rates. However, once a defense is applied, the success rates of baselines decrease dramatically to 10.47% and 12.06%, while the success rate of AFRAIDOOR are 77.05% and 92.98% on the two tasks. Our finding exposes security weaknesses in code models under stealthy backdoor attacks and shows that the state-of-the-art defense method cannot provide sufficient protection. We call for more research efforts in understanding security threats to code models and developing more effective countermeasures.
연구 동기 및 목표
- 코드 모델에 대한 보안 우려를 제시하고 백도어 공격에 대한 취약성을 강조합니다.
- 적응적 적대적 트리거를 통해 프로그램 의미를 보존하는 은밀한 백도어 접근 방식을 제안합니다.
- 여러 코드 모델과 다운스트림 작업에서 공격을 평가하고, 여러 방어 하에서 기존 기준선과 비교합니다.
제안 방법
- Afraidoor를 소개합니다. 적응 트리거를 주입하기 위한 적대적 교란을 사용하는 은밀한 백도어 방법입니다.
- 코드의 의미를 보존하고 은밀함을 달성하기 위해 토큰 수준 트리거로 식별자 재명명을 사용합니다.
- 클린 데이터로 학습된 제작 모델을 통해 목표성 백도어를 구성하고, 그래디언트 기반 최적화를 통해 적응 트리거를 생성합니다.
- 트리거를 삽입하고 대상 τ로의 라벨을 다시 지정하는 트리거 삽입기를 이용해 데이터셋을 오염시키고 Mb 모델을 학습합니다.
- 추론 시 같은 트리거 삽입기 I(·)를 적용하여 τ 출력을 강제함으로써 백도어를 활성화합니다.
- 세 가지 방어(스펙트럴 시그니처, ONION, activation clustering) 및 사용자 연구를 통해 평가합니다.

실험 결과
연구 질문
- RQ1은밀하고 적응적인 트리거가 다양한 작업과 모델에서 코드 모델에 얼마나 효과적인가?
- RQ2적응형 백도어가 최첨단 방어 및 데이터 정화를 견딜 수 있는가?
- RQ3사람은 자동 탐지기만큼 은밀한 백도어 트리거를 쉽게 감지하는가?
주요 결과
- Afraidoor의 적응 트리거는 방어 하에서도 여전히 높은 효과를 보이며, 특정 설정에서 스펙트럴 시그니처의 우회율이 약 85%에 이르는 반면, 이전 연구는 12% 미만에 그칩니다.
- 방어 하에서 Ramakrishnan 등(Baseline 공격)의 성능은 급격히 떨어지는 반면, Afraidoor는 두 작업에서 높은 공격 성공률을 유지합니다.
- Activation clustering 및 스펙트럴 시그니처 방어는 Afraidoor와 기준선 간에 효과가 다르게 나타나며, 은밀성 측면에서 질적 결과가 Afraidoор를 우위로 보여줍니다.
- 사용자 연구에서 Afraidoor로 오염된 예시는 기준선보다 식별이 더 어렵고 시간이 오래 걸려 사람에 대한 은밀성이 높음을 시사합니다.

더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.