Vibe Coding and Web Application Security: A Twin-Prompt Study

📄 arXiv: 2608.20963v1 📥 PDF

作者: Darko Andročec

分类: cs.CR, cs.AI

发布日期: 2026-08-21

备注: Accepted for presentation at the 37th Central European Conference on Information and Intelligent Systems (CECIIS 2026), September 16-18, 2026, Varazdin, Croatia. Author's accepted manuscript


💡 一句话要点

研究安全意识提示对生成Web应用程序安全性的影响

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: Web应用程序 安全性 大型语言模型 生成模型 安全最佳实践 编码助手 静态分析 动态测试

📋 核心要点

  1. 现有方法在生成Web应用程序时,往往忽视安全性,导致潜在的安全漏洞。
  2. 本文通过对比安全意识提示与基线提示,探讨安全最佳实践对生成结果的影响。
  3. 实验结果显示,安全意识变体的确认发现显著减少,且未出现严重安全问题,验证了安全提示的有效性。

📝 摘要(中文)

随着大型语言模型能够根据自然语言提示生成完整的Web应用程序,本文探讨了明确请求安全最佳实践是否能改善生成结果。研究了六个功能上不同的Web应用程序,每个应用程序生成了两个提示变体:基线(A)和安全意识(B)变体。所有程序均由同一编码助手和模型版本在单次生成中产生,并通过静态、依赖性、动态和手动技术进行分析,确认了75个发现。安全意识变体在每个应用程序中产生的确认发现更少(24对51),且没有严重或高风险问题。由于样本量小且每个变体仅生成一次,本文报告了描述性观察,而非统计效应,并将此工作定位为初步研究,正在扩展到多个模型和重复运行。

🔬 方法详解

问题定义:本文旨在解决在生成Web应用程序时,安全性被忽视的问题。现有方法缺乏对安全最佳实践的关注,导致生成的应用程序存在安全漏洞。

核心思路:通过在提示中添加安全要求部分,比较安全意识变体与基线变体的生成结果,以评估安全提示对生成应用程序安全性的影响。

技术框架:研究设计包括生成六个功能不同的Web应用程序,每个应用程序生成两个变体(A和B),并通过静态、动态、依赖性和手动测试进行分析。

关键创新:本研究的创新在于系统性地评估安全意识提示对生成Web应用程序的影响,首次提供了安全提示在生成过程中的实证数据。

关键设计:在生成过程中,使用相同的编码助手和模型版本,确保生成的一致性。每个变体的安全性通过多种测试方法进行评估,确保结果的全面性和准确性。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果显示,安全意识变体在每个应用程序中确认的安全问题数量显著减少,从51个降至24个,且未出现任何严重或高风险问题。这表明安全提示在生成Web应用程序时具有显著的正面影响。

🎯 应用场景

该研究的潜在应用领域包括Web应用程序开发和安全性评估。通过引入安全意识提示,开发者可以在生成应用程序时更好地遵循安全最佳实践,从而减少安全漏洞的风险。未来,该方法可扩展至更多模型和应用场景,推动安全编码标准的普及。

📄 摘要(原文)

Large language models increasingly generate complete web applications from natural-language prompts, raising the question of whether explicitly requesting security best practice improves the result. We study six functionally distinct web applications, each generated in two prompt variants that are identical except for an appended security-requirements section: a baseline (A) and a security-aware (B) variant. All twelve programs were produced by the same agentic coding assistant and the same model version in a single, non-iterative generation round, and were then analyzed with static, dependency, dynamic and manual techniques, yielding 75 confirmed findings out of 85 candidates. The security-aware variant produced fewer confirmed findings in every application (24 versus 51) and contained no Critical or High issues; the most severe finding was detected only by manual testing. Because the corpus is small and each variant was generated once, we report descriptive observations rather than statistically established effects, and position the work as a preliminary study whose pipeline is being scaled to multiple models and repeated runs.