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.
翻译:近年来,软件漏洞检测领域的发展主要由基于语言模型(LM)的方法推动。然而,这些模型仍然容易受到利用词汇和语法扰动的对抗性攻击,导致关键漏洞逃避检测。现有针对基于LM的漏洞检测器的黑盒攻击主要依赖于孤立的扰动策略,限制了其高效探索对抗性代码空间以寻找最优扰动的能力。为弥补这一差距,我们提出了HogVul,一个黑盒对抗性代码生成框架。该框架在粒子群优化(PSO)驱动的统一双通道优化策略下,整合了词汇和语法扰动。通过系统性地协调两级扰动,HogVul有效扩展了对抗样本的搜索空间,从而提升了攻击效能。在四个基准数据集上进行的大量实验表明,与最先进的基线方法相比,HogVul的平均攻击成功率提升了26.05%。这些发现凸显了混合优化策略在暴露模型脆弱性方面的潜力。