arXiv:2602.04894cs.CRcs.AI2026-02被引 2

发现大模型生成代码的漏洞模式,无需源码即可预测漏洞。

Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software

  • 通过前端特征和大模型信息,黑盒预测后端漏洞。
  • 跨领域攻击成功率最高达94%,漏洞覆盖率达93%。
  • 适合安全研究者和代码生成使用者关注漏洞风险。

大模型广泛用于代码生成,但其输出常遵循重复模板,导致可预测的漏洞。本文研究大模型生成代码中漏洞的持续性,提出特征-安全表(FSTab),包含两部分:一是无需访问后端或源码,仅凭前端特征与源模型知识,实现黑盒攻击以预测潜在漏洞;二是提供模型中心评估,量化模型在不同程序、语义不变改写及应用领域中对同一漏洞的重复生成能力。我们在GPT-5.2、Claude-4.5 Opus和Gemini-3 Pro等前沿代码大模型上评估,涵盖多种应用领域。结果表明,即使目标领域未参与训练,FSTab仍能达到最高94%的攻击成功率和93%的漏洞覆盖率(针对Internal Tools,使用Claude-4.5 Opus)。这些发现揭示了大模型生成软件中被忽视的攻击面,凸显代码生成的安全隐患。代码已开源于https://github.com/fstabicml2026/FSTab。

原文摘要 · Abstract (English)

LLMs are increasingly used for code generation, but their outputs often follow recurring templates that can induce predictable vulnerabilities. We study vulnerability persistence in LLM-generated software and introduce Feature--Security Table (FSTab) with two components. First, FSTab enables a black-box attack that predicts likely backend vulnerabilities from observable frontend features and knowledge of the source LLM, without access to the backend or source code. Second, FSTab provides a model-centric evaluation that quantifies how consistently a model reproduces the same vulnerabilities across programs, semantics-preserving rephrasings, and application domains. We evaluate FSTab on state-of-the-art code LLMs, including GPT-5.2, Claude-4.5 Opus, and Gemini-3 Pro, across diverse application domains. Our results show strong cross-domain transfer: even when the target domain is excluded from training, FSTab achieves up to 94% attack success and 93% vulnerability coverage on Internal Tools (Claude-4.5 Opus). These findings expose an underexplored attack surface in LLM-generated software and highlight the security risks of code generation. Our code is available at https://github.com/fstabicml2026/FSTab

大模型安全漏洞检测代码生成黑盒攻击

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