TOSSS (Two-Option Secure Snippet Selection)
收藏资源简介:
TOSSS是由特文特大学等机构联合开发的代码安全基准测试数据集,旨在评估大型语言模型识别安全代码片段的能力。该数据集基于CVE数据库构建,通过MegaVul自动化管道提取了C/C++和Java语言中安全修复前后的函数级代码对,形成可扩展的测试案例。数据生成过程完全自动化,能够持续集成新披露的漏洞。该数据集主要应用于软件安全领域,用于量化LLMs在代码安全决策中的表现,并为模型安全性能提供标准化评估框架。
TOSSS is a code security benchmark dataset jointly developed by the University of Twente and other institutions, aiming to evaluate the ability of large language models (LLMs) to identify secure code snippets. Built upon the CVE database, this dataset extracts function-level code pairs before and after security fixes in C/C++ and Java via the MegaVul automated pipeline, forming scalable test cases. The entire data generation process is fully automated, enabling continuous integration of newly disclosed vulnerabilities. This dataset is primarily utilized in the software security domain to quantify the performance of LLMs in code security decision-making and provide a standardized evaluation framework for model security performance.
TOSSS-LLM-Benchmark 数据集概述
数据集简介
TOSSS(Two-Option Secure Snippet Selection)是一个基于CVE(通用漏洞披露)的软件安全基准测试,旨在评估大型语言模型(LLMs)在安全代码片段与易受攻击代码片段之间进行正确选择的能力。
核心目标
- 衡量LLMs在软件安全方面的能力。
- 为LLM提供一个介于0到1之间的安全评分:1分表示模型始终选择安全代码片段,0分表示始终选择易受攻击的代码片段。
数据来源与构建方法
- 基准测试直接依赖于从CVE数据库中挖掘的测试用例。
- 利用项目MegaVul提取安全修复前后的函数。
- 要求LLMs在同一函数的安全版本和易受攻击版本之间做出选择。
基准测试特点
- 覆盖范围广:与现有仅覆盖有限漏洞类型的安全基准不同,TOSSS基于CVE数据库,提供了一个可扩展的框架,能够随时间整合新披露的漏洞。
- 语言支持:评估涵盖C/C++和Java代码。
- 可扩展性:由于与CVE数据库对接,新漏洞和新语言可以轻松集成,确保基准测试保持最新,并能测试模型对新兴弱点的识别能力。
评估结果
- 在14个广泛使用的开源和闭源模型上进行了评估。
- 观察到的安全评分范围在0.48到0.89之间。
应用前景
TOSSS评分可作为LLM提供商现有基准测试报告的补充,纳入以安全为重点的评分指标。
相关资源
- 论文链接:https://arxiv.org/abs/2603.10969
- 基准测试流程示意图:
https://github.com/MarcT0K/TOSSS-LLM-Benchmark/blob/main/assets/benchmark-schema.drawio.png - 项目标识:
https://github.com/MarcT0K/TOSSS-LLM-Benchmark/blob/main/assets/tosss-logo.png



