← 研踪 PaperTrailarXiv:2607.00107 · v4
The Illusion of Safety: Multi-Tier Verification of AI vs. Human C++ Code
首次提交 2026-07-01 03:48
版本更新 2026-11-25 05:45
雷达观测 2026-11-26 10:24
摘要
As large language models (LLMs) are increasingly deployed for systems programming, their ability to generate secure C++ code remains a critical concern. Yet most security evaluations of AI-generated code rely on static analysis alone, which flags warnings without confirming runtime violations or reasoning about untested paths. This study investigates whether C++ code generated by open-weight LLMs is measurably less safe than human-written code, and whether common verification tools agree on the risk. We introduce VULBENCH-CPP, a benchmark of 8,918 C++ programs from three open-weight LLMs (Gemma 3 27B IT, LLaMA 3.3 70B Instruct, Qwen 2.5 Coder 32B Instruct) and human authors across 851 competitive-programming tasks. Each program is annotated by four verification tiers: functional testing, static analysis (cppcheck, clang-tidy), dynamic analysis (ASan/UBSan), and bounded model checking (ESBMC). Under static analysis the two look equally safe, but this is misleading. Accounting for the correlation among solutions to a shared task, we find that code from these models is roughly twice as likely as human code to trigger a confirmed runtime violation, even after controlling for code length and test pass-rate. Furthermore, bounded model checking disagrees with the sanitizers in direc- tion, flagging human code more often among the programs it can decide. The overall results suggest that different verification tiers flag different programs, and no single tier is sufficient. We release the benchmark, harness, and annotated results
观测到的版本
相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。
v4 · 2026-11-25 05:45 · 最新观测版本
The Illusion of Safety: Multi-Tier Verification of AI vs. Human C++ Code
As large language models (LLMs) are increasingly deployed for systems programming, their ability to generate secure C++ code remains a critical concern. Yet most security evaluations of AI-generated code rely on static analysis alone, which flags warnings without confirming runtime violations or reasoning about untested paths. This study investigates whether C++ code generated by open-weight LLMs is measurably less safe than human-written code, and whether common verification tools agree on the risk. We introduce VULBENCH-CPP, a benchmark of 8,918 C++ programs from three open-weight LLMs (Gemma 3 27B IT, LLaMA 3.3 70B Instruct, Qwen 2.5 Coder 32B Instruct) and human authors across 851 competitive-programming tasks. Each program is annotated by four verification tiers: functional testing, static analysis (cppcheck, clang-tidy), dynamic analysis (ASan/UBSan), and bounded model checking (ESBMC). Under static analysis the two look equally safe, but this is misleading. Accounting for the correlation among solutions to a shared task, we find that code from these models is roughly twice as likely as human code to trigger a confirmed runtime violation, even after controlling for code length and test pass-rate. Furthermore, bounded model checking disagrees with the sanitizers in direc- tion, flagging human code more often among the programs it can decide. The overall results suggest that different verification tiers flag different programs, and no single tier is sufficient. We release the benchmark, harness, and annotated results
查看此版本解读 →查看此版本原文 ↗