Skip to main content
QUICK REVIEW

[論文レビュー] Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanning

Shenao Yan, Shimaa Abd Allah Ahmed|arXiv (Cornell University)|Mar 17, 2026
Information and Cyber SecurityComputer Science被引用数 0
ひとこと要約

本論文は、CodeScan を提案する。コード生成 LLMs のブラックボックス汷 poisoning 探索フレームワークで、構造的ずれと LLM ベースの脆弱性分析を用いて攻撃ターゲットを検出・回復し、コード設定における BAIT を上回る。

ABSTRACT

Code generation large language models (LLMs) are increasingly integrated into modern software development workflows. Recent work has shown that these models are vulnerable to backdoor and poisoning attacks that induce the generation of insecure code, yet effective defenses remain limited. Existing scanning approaches rely on token-level generation consistency to invert attack targets, which is ineffective for source code where identical semantics can appear in diverse syntactic forms. We present CodeScan, which, to the best of our knowledge, is the first poisoning-scanning framework tailored to code generation models. CodeScan identifies attack targets by analyzing structural similarities across multiple generations conditioned on different clean prompts. It combines iterative divergence analysis with abstract syntax tree (AST)-based normalization to abstract away surface-level variation and unify semantically equivalent code, isolating structures that recur consistently across generations. CodeScan then applies LLM-based vulnerability analysis to determine whether the extracted structures contain security vulnerabilities and flags the model as compromised when such a structure is found. We evaluate CodeScan against four representative attacks under both backdoor and poisoning settings across three real-world vulnerability classes. Experiments on 108 models spanning three architectures and multiple model sizes demonstrate 97%+ detection accuracy with substantially lower false positives than prior methods.

研究の動機と目的

  • データ汚染およびバックドアによって引き起こされるコード生成 LLM の脆弱性を特定する。
  • トレーニングデータまたはモデル内部データにアクセスできないブラックボックス設定で機能する防御策を開発する。
  • トークンレベルのずれの限界を克服するため、構造的コードパターンと意味的脆弱性に焦点を当てる。
  • 複数のアーキテクチャ、モデルサイズ、脆弱性クラスに跨る有効性を評価する。

提案手法

  • クリーンなプロンプトでモデル語彙を横断し、各候補トークンに対する世代を収集する。
  • 生成コードをASTベースの表現に変換し、構造的類似性でクラスタリングして低い発散パターンを特定する。
  • 脆弱性検出器(LLMベース)を適用して、構造的に一貫したパターンが対象の脆弱性を含むかを評価する。
  • 関数呼び出しと引数の ASTベースの多数決投票を通じて、支配的な構造的クラスタから回復された攻撃ターゲットを抽出する。
  • 脆弱性検出器(GPT-5-mini)を用いて、偏った痕跡に指定された脆弱性が含まれるかを判断する。
  • CodeScan を BAIT と F1-score、精度、再現率、BLEU、AST距離、スキャンオーバーヘッドで比較する。

実験結果

リサーチクエスチョン

  • RQ1ブラックボックスで脆弱性志向のスキャニングアプローチは、コード生成 LLM のデータ汚染を信頼性高く検出できるか。
  • RQ2世代全体で構造的に一貫したコードパターンは、トークンレベル手法より攻撃ターゲットをより良く露呈するか。
  • RQ3LLMベースの脆弱性分析は、変換・難読化された攻撃ターゲットを堅牢に識別できるか。
  • RQ4CodeScan は BAIT と比較して、アーキテクチャ・サイズ・脆弱性クラスにおいてどのように性能を示すか。

主な発見

  • CodeScan は prior 方法よりはるかに低い偽陽性で 97%+ の検出精度を達成。
  • CodeScan は BAIT を上回り、評価で平均 F1スコアが 0.17 であった BAIT の成績を凌駕。
  • 三つのアーキテクチャと複数のサイズにまたがる 108 モデルを評価し、大規模モデル CodeLlama-34B などを含む。
  • CodeScan は構造的ずれと脆弱性分析を用いて攻撃ターゲットを回復する。
  • GPT-5-mini による脆弱性分析は、変換・難読化されたターゲットを効果的に検出する。
  • CodeScan は変換されたコードに対して堅牢で、実用的かつスケーラブルなスキャンを提供する。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。