arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.00889cs.SEcs.AI
收藏

SALLM:生成代码的安全评估

SALLM: Security Assessment of Generated Code

University of Notre Dame(圣母大学)

Mohammed Latif Siddiq, Joanna C. S. Santos, Sajith Devareddy, Anna Muller

AI总结:

针对现有基准忽视安全性和真实软件工程场景的问题,本文提出SALLM框架,通过安全中心化Python提示数据集、可配置评估技术和新指标,系统评估LLMs生成安全代码的能力。

摘要:

随着大型语言模型(LLMs)在软件工程师日常实践中的日益普及,确保这些工具生成的代码不仅在功能上正确,而且没有漏洞变得十分重要。尽管LLMs可以帮助开发者提高生产力,但先前的实证研究表明,LLMs可能生成不安全的代码。导致不安全代码生成的因素有两个。第一,用于评估LLMs的现有数据集不能充分代表对安全性敏感的真实软件工程任务。相反,它们通常基于竞赛性编程题目或课堂式编码任务。在现实应用中,生成的代码会被集成到更大的代码库中,从而引入潜在的安全风险。第二,现有的评估指标主要关注生成代码的功能正确性,而忽略了安全性方面的考虑。因此,在本文中,我们描述了SALLM,一个用于系统性地基准测试LLMs生成安全代码能力的框架。该框架包含三个主要组成部分:一个以安全为中心的Python提示词新数据集、用于评估生成代码的可配置评估技术,以及从安全代码生成角度评估模型性能的新指标。

英文摘要:

With the growing popularity of Large Language Models (LLMs) in software engineers' daily practices, it is important to ensure that the code generated by these tools is not only functionally correct but also free of vulnerabilities. Although LLMs can help developers to be more productive, prior empirical studies have shown that LLMs can generate insecure code. There are two contributing factors to the insecure code generation. First, existing datasets used to evaluate LLMs do not adequately represent genuine software engineering tasks sensitive to security. Instead, they are often based on competitive programming challenges or classroom-type coding tasks. In real-world applications, the code produced is integrated into larger codebases, introducing potential security risks. Second, existing evaluation metrics primarily focus on the functional correctness of the generated code while ignoring security considerations. Therefore, in this paper, we described SALLM, a framework to benchmark LLMs' abilities to generate secure code systematically. This framework has three major components: a novel dataset of security-centric Python prompts, configurable assessment techniques to evaluate the generated code, and novel metrics to evaluate the models' performance from the perspective of secure code generation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑