[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82463-en":3,"doc-seo-82463-105":30,"detail-sidebar-cat-0-en-105":95},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},82463,1099513958607,"Jiven","https://ap-avatar.wpscdn.com/avatar/100002390cf8733938c?x-image-process=image/resize,m_fixed,w_180,h_180&k=1778829742770036399",8,"Research & Report","The Illusion of Safety: Multi-Tier Verification of AI vs. Human C++ Code","Large language models increasingly generate C++, a memory-unsafe language where small oversights can become exploitable bugs. Most AI-code security evaluations rely on static analysis alone, which cannot confirm runtime violations or cover untested paths. This work asks whether AI-generated C++ is measurably less safe than human-written code and whether verification tools agree. It introduces VULBENCH-CPP with 8,918 programs, each labeled across four verification tiers, finding AI code about twice as likely to trigger confirmed runtime memory-safety violations.","The Illusion of Safety: Multi-Tier Verification of AI  \nvs . Human C++ Code  \nSaif Mahmud∗ , Fadul Sikder∗ , Yuede Ji∗ , Zhang Haotian†, and Jeff (Yu) Lei∗  \n∗ Computer Science and Engineering, The University of Texas at Arlington, Arlington, Texas, USA  \nEmail: {sxm8931, [fxs5359](fxs5359}@mavs.uta.edu)[}](fxs5359}@mavs.uta.edu)[@mavs.uta.edu](fxs5359}@mavs.uta.edu), {yuede.ji, [ylei](ylei}@uta.edu)[}](ylei}@uta.edu)[@uta.edu](ylei}@uta.edu)  \n†Computer Science and Engineering, New Jersey Institute of Technology, Newark, New Jersey, USA  \nEmail: [haotian.zhang@njit.edu](haotian.zhang@njit.edu)  \narXiv :2607 .00 107v2 [ cs . SE] 5 Jul 2026  \nAbstract—Large language models increasingly generate C++, a memory-unsafe language where a single overlooked violation can become an exploitable bug. 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. We ask whether AI-generated C++ 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). Accounting for the correlation among solutions to a shared task, we find that AIgenerated code is roughly twice as likely as human code to trigger a confirmed runtime violation, even after controlling for code length and test pass-rate. Under static analysis the two look equally safe, but this is misleading: the apparent similarity reflects code length rather than real safety, and the tiers detect largely different classes of violation, so no single tier is sufficient. The gap is consistent across independent generations. We plan to release the benchmark, harness, and annotated results in future. Findings are scoped to short, algorithmic C++ under zero-shot generation.  \nI. INTRODUCTION  \nProblem and importance. Large language models (LLMs) are increasingly used to generate source code in professional software development [1] . GitHub reports that AI-assisted coding now contributes to a substantial and growing fraction of code in active repositories [2], [3], and enterprise adoption is accelerating across systems programming, embedded development, and high-performance computing, domains where C++ dominates. For memory-unsafe languages like C++, which provides no runtime exceptions or memory safety guarantees, the stakes are particularly high: a single buffer overflow or use-after-free vulnerability translates to an exploitable security breach or silent data corruption [4] . The central question is unavoidable: how secure is AI-generated C++ code, and can practitioners trust existing verification practices to catch its flaws?  \nThe danger of static-only evaluation. Prior evaluations of AIgenerated code security have employed static analysis as their primary (or exclusive) verification method [3], [5], [7] . For  \nC++ in particular, static-only evaluation creates a dangerous illusion of security. Static tools (cppcheck, clang-tidy) report comparable warning rates for AI-generated and human-written code, superficially suggesting the two are equally safe. However, static analysis cannot confirm that warnings correspond to true runtime violations, nor can it reason about untested code paths. This methodological limitation conceals a critical vulnerability gap: AI-generated C++ code triggers confirmed runtime memory-safety violations at several times the rate of human-written code, a gap invisible to static analysis alone. Practitioners relying exclusively on static checks deploy AI code with undetected runtime vulnerabilities accumulating unnotice","cbCaic21wC1aTTkP","https://ap.wps.com/l/cbCaic21wC1aTTkP","pdf",490428,2,1,12,"English","en",105,"# Introduction\n## Problem and importance\n## The danger of static-only evaluation\n## The inadequacy of any single verification tier\n## Approach and benchmark construction","[{\"question\":\"What problem does the study address about AI-generated C++ code?\",\"answer\":\"The study investigates whether AI-generated C++ is less secure than human-written code, especially given that C++ is memory-unsafe and that static-only evaluation can miss real runtime vulnerabilities.\"},{\"question\":\"How is VULBENCH-CPP constructed and what does it cover?\",\"answer\":\"VULBENCH-CPP includes 8,918 C++ programs across 851 competitive-programming tasks, combining outputs from three open-weight LLMs with human reference solutions.\"},{\"question\":\"What four verification tiers does the benchmark use for each program?\",\"answer\":\"Each program is annotated with functional testing, static analysis (cppcheck, clang-tidy), dynamic analysis (ASan/UBSan), and bounded model checking (ESBMC).\"},{\"question\":\"Why is static analysis alone considered misleading in this context?\",\"answer\":\"Static tools may report similar warning rates for AI and human code, but they cannot confirm that warnings correspond to true runtime violations or reason about code paths not exercised by tests.\"}]",1784180629,30,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":90,"head_meta":92,"extra_data":94,"updated_unix":28},"the-illusion-of-safety-multi-tier-verification-of-ai-vs-human-c-code","",{"@graph":36,"@context":89},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,47,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":20},"https://docshare.wps.com/document/","Document",{"item":48,"name":12,"@type":43,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/the-illusion-of-safety-multi-tier-verification-of-ai-vs-human-c-code/82463/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-22","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81,85],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does the study address about AI-generated C++ code?","Question",{"text":75,"@type":76},"The study investigates whether AI-generated C++ is less secure than human-written code, especially given that C++ is memory-unsafe and that static-only evaluation can miss real runtime vulnerabilities.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How is VULBENCH-CPP constructed and what does it cover?",{"text":80,"@type":76},"VULBENCH-CPP includes 8,918 C++ programs across 851 competitive-programming tasks, combining outputs from three open-weight LLMs with human reference solutions.",{"name":82,"@type":73,"acceptedAnswer":83},"What four verification tiers does the benchmark use for each program?",{"text":84,"@type":76},"Each program is annotated with functional testing, static analysis (cppcheck, clang-tidy), dynamic analysis (ASan/UBSan), and bounded model checking (ESBMC).",{"name":86,"@type":73,"acceptedAnswer":87},"Why is static analysis alone considered misleading in this context?",{"text":88,"@type":76},"Static tools may report similar warning rates for AI and human code, but they cannot confirm that warnings correspond to true runtime violations or reason about code paths not exercised by tests.","https://schema.org",{"og:url":51,"og:type":91,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":93,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":96},[97,101,105,109,114,119,124,126,131,134,138],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Story & Novel",90,"story-novel",{"id":20,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":106,"show_sort_weight":107,"slug":108},"Exam",70,"exam",{"id":110,"doc_module":4,"doc_module_name":46,"category_name":111,"show_sort_weight":112,"slug":113},5,"Comic",60,"comic",{"id":115,"doc_module":4,"doc_module_name":46,"category_name":116,"show_sort_weight":117,"slug":118},6,"Technology",50,"technology",{"id":120,"doc_module":4,"doc_module_name":46,"category_name":121,"show_sort_weight":122,"slug":123},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":29,"slug":125},"research-report",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":129,"slug":130},9,"Religion & Spirituality",20,"religion-spirituality",{"id":129,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":129,"slug":133},"World Cup","world-cup",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":135,"slug":137},10,"Lifestyle","lifestyle",{"id":139,"doc_module":4,"doc_module_name":46,"category_name":140,"show_sort_weight":110,"slug":141},19,"General","general"]