当AI掌控方向盘:框架约束程序生成的安全性分析
When AI Takes the Wheel: Security Analysis of Framework-Constrained Program Generation
AI总结:
本研究调查最先进LLMs生成的框架约束程序的安全属性,聚焦Chrome扩展场景构建含140个提示词的ChromeSecBench数据集,分析9个LLMs生成的扩展漏洞,发现其生成易受攻击程序比例达18%-50%,高级推理模型表现更差,凸显LLMs编码能力与编写安全程序能力的差距。
摘要:
近年来,人工智能浪潮在软件开发领域迅速兴起。借助大型语言模型(LLMs),即使是新手开发者也能根据高层需求设计并生成复杂的框架约束软件系统。然而,当LLMs逐渐“掌控”软件开发的主导权时,开发者可能仅检查程序是否能运行,却常常忽略生成程序实现方式中隐藏的安全问题。在本研究中,我们调查了由最先进LLMs生成的框架约束程序的安全属性。由于Chrome扩展涉及多权限边界和隔离组件的复杂安全模型,我们特别聚焦于该场景。为此,我们构建了ChromeSecBench数据集,包含基于已知易受攻击扩展的140个提示词。我们使用这些提示词指导9个最先进LLMs生成完整的Chrome扩展,然后从场景类型、模型差异和漏洞类别三个维度分析其漏洞。结果显示,LLMs生成易受攻击程序的比例高得惊人(18%-50%),尤其在身份验证与标识(最高83%)和Cookie管理(最高78%)场景中。大多数漏洞将Cookie、历史记录或书签等敏感浏览器数据暴露给不可信代码。有趣的是,我们发现高级推理模型表现更差,生成的漏洞比简单模型更多。这些发现凸显了LLMs的编码能力与其编写安全框架约束程序能力之间的关键差距。
英文摘要:
In recent years, the AI wave has grown rapidly in software development. Even novice developers can now design and generate complex framework-constrained software systems based on their high-level requirements with the help of Large Language Models (LLMs). However, when LLMs gradually "take the wheel" of software development, developers may only check whether the program works. They often miss security problems hidden in how the generated programs are implemented. In this work, we investigate the security properties of framework-constrained programs generated by state-of-the-art LLMs. We focus specifically on Chrome extensions due to their complex security model involving multiple privilege boundaries and isolated components. To achieve this, we built ChromeSecBench, a dataset with 140 prompts based on known vulnerable extensions. We used these prompts to instruct nine state-of-the-art LLMs to generate complete Chrome extensions, and then analyzed them for vulnerabilities across three dimensions: scenario types, model differences, and vulnerability categories. Our results show that LLMs produced vulnerable programs at alarmingly high rates (18%-50%), particularly in Authentication & Identity and Cookie Management scenarios (up to 83% and 78% respectively). Most vulnerabilities exposed sensitive browser data like cookies, history, or bookmarks to untrusted code. Interestingly, we found that advanced reasoning models performed worse, generating more vulnerabilities than simpler models. These findings highlight a critical gap between LLMs' coding skills and their ability to write secure framework-constrained programs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。