用自动化框架检测大模型生成诈骗代码的风险,发现多个主流模型普遍存在漏洞。
Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMs
- 构建开发者风格提示词,模拟钓鱼网站意图测试模型响应
- 四款主流模型中4.24%生成恶意链接,2025年新模型最高达47.3%
- 现有安全防护措施无法有效阻止该类攻击,适合关注AI安全的开发者
大型语言模型已成为现代软件开发的核心,但其训练依赖未经筛选的网络规模数据集,带来显著安全风险:可能吸收并复现恶意内容。2024年11月,一名用户因执行ChatGPT生成的含真实钓鱼链接代码,损失2,500美元。为系统评估此风险,我们提出Scam2Prompt——一种可扩展的自动化审计框架,通过识别诈骗网站的潜在意图,并合成开发者风格提示词来测试模型是否会产生恶意代码。在对四个生产级模型(GPT-4o、GPT-4o-mini、Llama-4-Scout、DeepSeek-V3)的大规模测试中,此类提示触发恶意URL生成的比例达4.24%。为检验风险持续性,我们构建了Innoc2Scam-bench基准,包含1,377个提示,均能持续引发四款初始模型生成恶意代码。应用于七款2025年发布的新增产模型时,该漏洞依然存在且严重,恶意代码生成率介于12.9%至47.3%之间。此外,现有最先进的安全防护机制如高级护栏或基于RAG的代理,均无法有效防止此类行为。
原文摘要 · Abstract (English)
Large Language Models have become critical to modern software development, but their reliance on uncurated web-scale datasets for training introduces a significant security risk: the absorption and reproduction of malicious content. This risk materialized in November 2024, when a user suffered a 2,500 USD financial loss after executing code generated by ChatGPT that contained a live scam phishing URL. To systematically evaluate this risk, we introduce Scam2Prompt, a scalable automated auditing framework that identifies the underlying intent of a scam site and then synthesizes developer-style prompts that mirror this intent, allowing us to test whether an LLM will generate malicious code in response to these prompts. In a large-scale study of four production LLMs (GPT-4o, GPT-4o-mini, Llama-4-Scout, and DeepSeek-V3), we found that Scam2Prompt's developer-style prompts triggered malicious URL generation in 4.24\% of cases. To test the persistence of this security risk, we constructed Innoc2Scam-bench, a benchmark of 1,377 prompts that consistently elicited malicious code from all four initial LLMs. When applied to seven additional production LLMs released in 2025, we found the vulnerability is not only present but severe, with malicious code generation rates ranging from 12.9\% to 47.3\%. Furthermore, existing safety measures like state-of-the-art guardrails or RAG-based agents proved insufficient to prevent this behavior.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。