arXiv:2601.05587cs.CRcs.AI2026-01AAAI被引 3

用粒子群优化生成对抗代码,绕过基于大模型的漏洞检测

HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectors

  • 双通道优化融合词法与语法扰动,统一生成对抗样本
  • 在4个数据集上平均攻击成功率提升26.05%
  • 适合研究漏洞检测安全或对抗攻防的学者

近期软件漏洞检测主要依赖基于语言模型(LM)的方法。然而,这些模型易受词汇和语法扰动的对抗攻击,导致关键漏洞被规避。现有黑盒攻击多采用孤立扰动策略,难以高效探索对抗代码空间以寻找最优扰动。为此,我们提出HogVul,一种基于粒子群优化(PSO)的黑盒对抗代码生成框架,通过统一的双通道优化策略整合词法与语法扰动。该方法系统协调两级扰动,有效扩展对抗样本搜索空间,提升攻击效果。在四个基准数据集上的大量实验表明,HogVul相比最先进基线方法平均攻击成功率提升26.05%。结果凸显了混合优化策略在暴露模型漏洞方面的潜力。

原文摘要 · Abstract (English)

Recent advances in software vulnerability detection have been driven by Language Model (LM)-based approaches. However, these models remain vulnerable to adversarial attacks that exploit lexical and syntax perturbations, allowing critical flaws to evade detection. Existing black-box attacks on LM-based vulnerability detectors primarily rely on isolated perturbation strategies, limiting their ability to efficiently explore the adversarial code space for optimal perturbations. To bridge this gap, we propose HogVul, a black-box adversarial code generation framework that integrates both lexical and syntax perturbations under a unified dual-channel optimization strategy driven by Particle Swarm Optimization (PSO). By systematically coordinating two-level perturbations, HogVul effectively expands the search space for adversarial examples, enhancing the attack efficacy. Extensive experiments on four benchmark datasets demonstrate that HogVul achieves an average attack success rate improvement of 26.05\% over state-of-the-art baseline methods. These findings highlight the potential of hybrid optimization strategies in exposing model vulnerabilities.

对抗攻击漏洞检测代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。