paper-with-me

홈 › Papers

Black-Box Adversarial Attacks on LLM-Based Code Completion

2024-08-05 · Slobodan Jenko, Niels Mündler, Jingxuan He, Mark Vero, Martin Vechev

Modern code completion engines, powered by large language models (LLMs), assist millions of developers with their strong capabilities to generate functionally correct code. Due to this popularity, it is crucial to investigate the security implications of relying on LLM-based code completion. In this work, we demonstrate that state-of-the-art black-box LLM-based code completion engines can be stealthily biased by adversaries to significantly increase their rate of insecure code generation. We present the first attack, named INSEC, that achieves this goal. INSEC works by injecting an attack string as a short comment in the completion input. The attack string is crafted through a query-based optimization procedure starting from a set of carefully designed initialization schemes. We demonstrate INSEC's broad applicability and effectiveness by evaluating it on various state-of-the-art open-source models and black-box commercial services (e.g., OpenAI API and GitHub Copilot). On a diverse set of security-critical test cases, covering 16 CWEs across 5 programming languages, INSEC increases the rate of generated insecure code by more than 50%, while maintaining the functional correctness of generated code. We consider INSEC practical -- it requires low resources and costs less than 10 US dollars to develop on commodity hardware. Moreover, we showcase the attack's real-world deployability, by developing an IDE plug-in that stealthily injects INSEC into the GitHub Copilot extension.

📄 PDF Abstract BibTeX arXiv:2408.02509

Code (0)

등록된 구현이 없습니다.

Tasks

Code CompletionCode Generation

Methods 이 논문이 사용한 방법론

SET Dynamic Sparse Training method where weight mask is updated randomly periodically

Similar Papers 제목 키워드 기반

Transferable 3D Adversarial Shape Completion using Diffusion Models

2024-07-14 · Xuelong Dai, Bin Xiao

Recent studies that incorporate geometric features and transformers into 3D point cloud feature learning have significantly improved the performance of 3D deep-learning models. However, their robustness against adversari…

3D Point Cloud ClassificationAdversarial AttackPoint Cloud Classification

Black-Box Adversarial Attack on Vision Language Models for Autonomous Driving

2025-01-23 · Lu Wang, Tianyuan Zhang, Yang Qu, Siyuan Liang 외

Vision-language models (VLMs) have significantly advanced autonomous driving (AD) by enhancing reasoning capabilities; however, these models remain highly susceptible to adversarial attacks. While existing research has e…

Adversarial AttackAutonomous Driving

Effective Code Membership Inference for Code Completion Models via Adversarial Prompts

2025-11-19 · Yuan Jiang, Zehao Li, Shan Huang, Christoph Treude 외 arxiv

Membership inference attacks (MIAs) on code completion models offer an effective way to assess privacy risks by inferring whether a given code snippet was part of the training data. Existing black- and gray-box MIAs rely…

Code Completion

Structure-Preserving Progressive Low-rank Image Completion for Defending Adversarial Attacks

2021-03-04 · Zhiqun Zhao, Hengyou Wang, Hao Sun, Zhihai He

Deep neural networks recognize objects by analyzing local image details and summarizing their information along the inference layers to derive the final decision. Because of this, they are prone to adversarial attacks. S…

Adversarial RobustnessLow-Rank Matrix CompletionMatrix Completion

Spanning Attack: Reinforce Black-box Attacks with Unlabeled Data

2020-05-11 · Lu Wang, huan zhang, Jin-Feng Yi, Cho-Jui Hsieh 외

Adversarial black-box attacks aim to craft adversarial perturbations by querying input-output pairs of machine learning models. They are widely used to evaluate the robustness of pre-trained models. However, black-box at…