Large language models (LLMs) are widely used in software development. However, the code generated by LLMs often contains vulnerabilities. Several secure code generation methods have been proposed to address this issue, but their current evaluation schemes leave several concerns unaddressed. Specifically, most existing studies evaluate security and functional correctness separately, using different datasets. That is, they assess vulnerabilities using security-related code datasets while validating functionality with general code datasets. In addition, prior research primarily relies on a single static analyzer, CodeQL, to detect vulnerabilities in generated code, which limits the scope of security evaluation.
In this work, we conduct a comprehensive study to systematically assess the improvements introduced by four state-of-the-art secure code generation techniques. Specifically, we apply both security inspection and functionality validation to the same generated code and evaluate these two aspects together. We also employ three popular static analyzers and two LLMs to identify potential vulnerabilities in the generated code. Our study reveals that existing techniques often compromise the functionality of generated code to enhance security. Their overall performance remains limited when evaluating security and functionality together. In fact, many techniques even degrade the performance of the base LLM by more than 50%. Our further inspection reveals that these techniques often either remove vulnerable lines of code entirely or generate ``garbage code'' that is unrelated to the intended task. Moreover, the commonly used static analyzer CodeQL fails to detect several vulnerabilities, further obscuring the actual security improvements achieved by existing techniques.
Making Code Voting Secure against Insider Threats using Unconditionally Secure MIX Schemes and Human PSMT Protocols
代码投票是Chaum引入的一种解决方案,用于使用可能被恶意软件感染的设备在电子投票应用程序中投票。Chaum在代码投票方面的工作假设投票代码是使用邮件系统物理地传递给投票者的,隐含地要求信任邮件系统。这不一定是一个有效的假设-特别是如果邮件系统不可信。当与选票的接收者合谋时,隐私就被破坏了。很明显,当涉及到隐私时,计算机和互联网上的“安全”通信不能完全信任。这强调了使用的重要性:(1)安全网络通信的无条件安全性。(2)减少对不可信计算机的依赖。在本文中,我们将探讨如何消除邮件系统的信任假设的代码投票。我们使用PSMT协议(SCN 2012),其中在视觉辅助的帮助下,人类可以以99\%的准确度正确地进行$\mod 10$添加。我们介绍了一个无条件安全的MIX基于组合数学的集合系统。鉴于我们提出的投票方案的最终用户是人类,我们\emph{cannot use}经典的安全多方计算协议。我们的解决方案适用于单议席和多议席选举,实现:\begin{enumerate}[i)] \item An anonymous and perfectly secure communication network secure against a $t$-bounded passive adversary used to deliver voting, \item The end step of the p…
Rethinking Autonomy: Preventing Failures in AI-Driven Software Engineering
Department of CSE Chandigarh University Mohali, India(计算机科学与工程系 奇纳格里大学 莫哈利,印度);Department of CST Tsinghua University Beijing, China(计算机科学与技术系 清华大学 北京,中国)
Last Secure Code Benchmark: Is the Code You Vibe Secure?
National University of Singapore(新加坡国立大学);Qwen Team, Alibaba Token Hub, Alibaba Group(阿里通义千问团队、阿里Token Hub、阿里巴巴集团);Cloud Safety and Security, Alibaba Cloud, Alibaba Group(阿里云云安全与安全部门、阿里云、阿里巴巴集团)
本研究推出 Last Secure Code Benchmark 评估编码智能体的安全代码生成,发现前沿智能体生成的代码功能通过率高但安全通过率低,vibe 编码生成代码的安全性存在严重隐患。
CodeBC: A More Secure Large Language Model for Smart Contract Code Generation in Blockchain
State Key Laboratory of Complex & Critical Software Environment, Beihang University(复杂与关键软件环境国家重点实验室,北京航空航天大学);School of Artificial Intelligence, Beihang University(人工智能学院,北京航空航天大学);Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing(未来区块链与隐私计算北京先进创新中心);Beijing Academy of Blockchain and Edge Computing, BABEC(区块链与边缘计算北京研究院,BABEC)
What If Prompt Injection Never Left? Rethinking Agent Security through Cross-Session Stored Prompt Injection
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);AI Sec Lab, Beijing Chaitin Technology Co.,Ltd(北京柴坦科技有限公司AI安全实验室)
Demo: SGCode: A Flexible Prompt-Optimizing System for Secure Generation of Code
New Jersey Institute of Technology(新泽西理工学院);Kent State University(肯特州立大学);Qatar Computing Research Institute(卡塔尔计算研究所);Microsoft Azure AI(微软 Azure 人工智能)