SafeGenBench: A Benchmark Framework for Security Vulnerability Detection in LLM-Generated Code
Not on the map. Why?
Abstract (arXiv)
The code generation capabilities of large language models(LLMs) have emerged as a critical dimension in evaluating their overall performance. However, prior research has largely overlooked the security risks inherent in the generated code. In this work, we introduce SafeGenBench, a benchmark specifically designed to assess the security of LLM-generated code. The dataset encompasses a wide range of common software development scenarios and vulnerability types. Building upon this benchmark, we develop an automatic evaluation framework that leverages both static application security testing(SAST) and LLM-based judging to assess the presence of security vulnerabilities in model-generated code. Through the empirical evaluation of state-of-the-art LLMs on SafeGenBench, we reveal notable deficiencies in their ability to produce vulnerability-free code. Our findings highlight pressing challenges and offer actionable insights for future advancements in the secure code generation performance of LLMs. The data and code will be released soon.
Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 18 of its 29 references that are in the map. First posted on arXiv 6 Jun 2025.
Builds on
18 of 29 references.
References · 18
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2024A Survey on LLM-as-a-Judgecited by 1,423
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
- 2024MarsCode Agent: AI-native Automated Bug Fixingcited by 71
6 more
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 59
- 2023CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Modelscited by 55
- 2024Investigating Large Language Models for Code Vulnerability Detection: An Experimental Studycited by 12
- 2024An Extensive Comparison of Static Application Security Testing Toolscited by 10
- 2024LLMSecCode: Evaluating Large Language Models for Secure Codingcited by 4
- 2020Vulnerabilities Mapping based on OWASP-SANS: a Survey for Static Application Security Testing (SAST)cited by 2
Built on by
Citing papers per year: 2025: 5; 2026: 14.
19 papers.
Sort:
By area:
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 14
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 13
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generationcited by 5
- 2026TriggerBench: Investigating Prospective Memory for Large Language Modelscited by 5
- 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?cited by 3
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMscited by 2
- 2026Accelerating Scientific Research with Gemini in the Real-Worldcited by 2
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Softwarecited by 1
- 2026SecCodeBench-V2 Technical Reportcited by 1
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Modelscited by 1
- 2026FinRED: An Expert-Guided Benchmark Generation and Evaluation Framework for Financial LLM Red-Teamingcited by 1
7 more
- 2026VulReaD: Knowledge-Graph-guided Software Vulnerability Reasoning and Detectioncited by 0
- 2026CoT-Guard: Small Models for Strong Monitoringcited by 0
- 2026ASSEMBLAGE-DEEPHISTORY: A Cross-Build Binary Dataset with Temporal Coveragecited by 0
- 2026An Empirical Study of Security Calibration in Large Language Models for Codecited by 0
- 2026The Patchwork Problem in LLM-Generated Codecited by 0
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilitiescited by 0
- 2026Security in LLM-Assisted Coding: A Systematic Literature Reviewcited by 0
- 2026Security in LLM-Assisted Coding: A Systematic Literature Review11 Oct 2026
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilities14 Sep 2026
- 2026Accelerating Scientific Research with Gemini in the Real-World27 Aug 2026
- 2026The Patchwork Problem in LLM-Generated Code9 Jul 2026
- 2026An Empirical Study of Security Calibration in Large Language Models for Code30 Jun 2026
- 2026TriggerBench: Investigating Prospective Memory for Large Language Models22 Jun 2026
- 2026FinRED: An Expert-Guided Benchmark Generation and Evaluation Framework for Financial LLM Red-Teaming18 Jun 2026
- 2026ASSEMBLAGE-DEEPHISTORY: A Cross-Build Binary Dataset with Temporal Coverage20 May 2026
- 2026CoT-Guard: Small Models for Strong Monitoring12 May 2026
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Models11 Mar 2026
- 2026SecCodeBench-V2 Technical Report17 Feb 2026
- 2026VulReaD: Knowledge-Graph-guided Software Vulnerability Reasoning and Detection11 Feb 2026
7 more
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software2 Feb 2026
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generation20 Jan 2026
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents24 Nov 2025
- 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?15 Oct 2025
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios26 Sep 2025
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMs2 Sep 2025
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Code25 Aug 2025
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 13
- 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?cited by 3
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilitiescited by 0
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilities14 Sep 2026
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents24 Nov 2025
- 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?15 Oct 2025
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios26 Sep 2025
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 14
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generationcited by 5
- 2026TriggerBench: Investigating Prospective Memory for Large Language Modelscited by 5
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMscited by 2
- 2026Accelerating Scientific Research with Gemini in the Real-Worldcited by 2
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Softwarecited by 1
- 2026SecCodeBench-V2 Technical Reportcited by 1
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Modelscited by 1
- 2026ASSEMBLAGE-DEEPHISTORY: A Cross-Build Binary Dataset with Temporal Coveragecited by 0
- 2026An Empirical Study of Security Calibration in Large Language Models for Codecited by 0
- 2026The Patchwork Problem in LLM-Generated Codecited by 0
- 2026Security in LLM-Assisted Coding: A Systematic Literature Reviewcited by 0
- 2026Security in LLM-Assisted Coding: A Systematic Literature Review11 Oct 2026
- 2026Accelerating Scientific Research with Gemini in the Real-World27 Aug 2026
- 2026The Patchwork Problem in LLM-Generated Code9 Jul 2026
- 2026An Empirical Study of Security Calibration in Large Language Models for Code30 Jun 2026
- 2026TriggerBench: Investigating Prospective Memory for Large Language Models22 Jun 2026
- 2026ASSEMBLAGE-DEEPHISTORY: A Cross-Build Binary Dataset with Temporal Coverage20 May 2026
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Models11 Mar 2026
- 2026SecCodeBench-V2 Technical Report17 Feb 2026
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software2 Feb 2026
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generation20 Jan 2026
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMs2 Sep 2025
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Code25 Aug 2025