Toward Secure Code Generation: Bridging Correctness and Security via Task-Adaptive Vulnerability Modeling and Execution-Based Benchmarking
South China University of Technology(华南理工大学);University of Innsbruck(因斯布鲁克大学)
Jiexin Wang, Liuwen Cao, Xitong Luo, Yang Cao, Zhenghao Li, Yunyi Xiao, Mengchen Zhao, Adam Jatowt, Yi Cai
备注:
Substantially extended and revised version. CodeSecEval has been expanded from 180 tasks covering 44 vulnerability types to 255 executable Python tasks spanning 77 CWE categories. This version additionally introduces SecAwareCoder, a task-adaptive threat-modeling and execution-guided framework for secure code generation, together with new experiments and analyses. Accepted/published in ISSTA 2026
Large language models (LLMs) are increasingly used for program synthesis, yet they often generate code that is functionally plausible but insecure. Progress in secure code generation has been hindered by benchmarks that are small, non-executable, leak mitigation details, or rely on noisy analyzers and subjective judgments, making it difficult to measure whether security improves without sacrificing correctness. We address these gaps with CodeSecEval, an execution-based benchmark for secure code generation, comprising 255 Python tasks spanning 77 CWE categories. Each task provides paired insecure and secure implementations together with executable functional and vulnerability-targeted security tests, enabling precise and reproducible evaluation of secure code generation and insecure-code repair. Building on CodeSecEval, we propose SecAwareCoder, an agent-based framework that shifts code generation toward secure-by-construction synthesis. SecAwareCoder performs task-adaptive threat modeling to identify security-sensitive regions and derive task-grounded vulnerability hypotheses, uses these hypotheses to guide both constraint-aware code generation and security-aware test synthesis, and leverages execution feedback for targeted refinement. Experiments across multiple LLM backbones show that SecAwareCoder consistently improves Pass@1 and security robustness over prompting and analyzer-driven baselines, narrowing the security--correctness gap in LLM code generation.
An LLM-as-Judge Metric for Bridging the Gap with Human Evaluation in SE Tasks
Singapore Management University(新加坡国立管理学院);DGIST(韩国高等智能科学研究院);Monash University(墨尔本大学);Nanjing University of Aeronautics and Astronautics(南京航空航天大学);Huawei Software Engineering Application Technology Lab(华为软件工程应用技术实验室);Zhejiang University(浙江大学)
Bridging the Gap between User Intent and LLM: A Requirement Alignment Approach for Code Generation
School of Computer Science, Wuhan University(武汉大学计算机学院);Nanyang Technological University(南洋理工大学);Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);Key Lab of High Confidence Software Technology, MoE (Peking University)(北京大学 教育部高可信软件技术重点实验室);The University of Hong Kong(香港大学);Wuhan University(武汉大学);Peking University(北京大学)
Automated Exploit and Security Test Generation: A Systematic Literature Review
Hamburg University of Technology(汉堡工业大学);University of Trento(特伦托大学);University of Szeged(塞格德大学);University of Salerno(萨莱诺大学);FrontEndART Ltd.(FrontEndART有限公司);Vrije Universitiet Amsterdam(阿姆斯特丹自由大学)
Statistical Analysis of Executability and Program Equivalence in Decompilation for IoT Vulnerability Detection
College of Science and Technology, Nihon University(日本大学理工学部);Waseda Institute for Advanced Study, Waseda University(早稻田大学高等研究院);Graduate School of Informatics and Engineering, The University of Electro-Communications(电气通信大学信息工学研究科)
When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?
Carnegie Mellon University(卡内基梅隆大学);University of Michigan, Ann Arbor(密歇根大学安娜堡分校);Peking University(北京大学);Google(谷歌);Colorado State University(科罗拉多州立大学)