计算机科学 > 软件工程
[提交于 2026年6月30日 (v1),最后修订于 2026年11月24日 (此版本, v4)]
标题:The Illusion of Safety: Multi-Tier Verification of AI vs. Human C++ Code
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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