CASTLE: Benchmarking Dataset for Static Code Analyzers and LLMs towards CWE Detection
Not on the map. Why?
Abstract (arXiv)
Identifying vulnerabilities in source code is crucial, especially in critical software components. Existing methods such as static analysis, dynamic analysis, formal verification, and recently Large Language Models are widely used to detect security flaws. This paper introduces CASTLE (CWE Automated Security Testing and Low-Level Evaluation), a benchmarking framework for evaluating the vulnerability detection capabilities of different methods. We assess 13 static analysis tools, 10 LLMs, and 2 formal verification tools using a hand-crafted dataset of 250 micro-benchmark programs covering 25 common CWEs. We propose the CASTLE Score, a novel evaluation metric to ensure fair comparison. Our results reveal key differences: ESBMC (a formal verification tool) minimizes false positives but struggles with vulnerabilities beyond model checking, such as weak cryptography or SQL injection. Static analyzers suffer from high false positives, increasing manual validation efforts for developers. LLMs perform exceptionally well in the CASTLE dataset when identifying vulnerabilities in small code snippets. However, their accuracy declines, and hallucinations increase as the code size grows. These results suggest that LLMs could play a pivotal role in future security solutions, particularly within code completion frameworks, where they can provide real-time guidance to prevent vulnerabilities. The dataset is accessible at https://github.com/CASTLE-Benchmark.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 13 of its 32 references that are in the map. First posted on arXiv 12 Mar 2025.
Builds on
13 of 32 references.
References · 13
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
- 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
- 2023InferFix: End-to-End Program Repair with LLMscited by 113
- 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 100
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
- 2023A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verificationcited by 42
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 23
- 2024LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitationscited by 21
- 2024DLAP: A Deep Learning Augmented Large Language Model Prompting Framework for Software Vulnerability Detectioncited by 13
Built on by
Citing papers per year: 2025: 3; 2026: 7.
10 papers.
- 2025From LLM Reasoning to Autonomous AI Agents: A Comprehensive Reviewcited by 146
- 2026SastBench: A Benchmark for Testing Agentic SAST Triagecited by 2
- 2025You Have Been LaTeXpOsEd: A Systematic Analysis of Information Leakage in Preprint Archives Using Large Language Modelscited by 1
- 2026Adaptive Hierarchical Evaluation of LLMs and SAST tools for CWE Prediction in Pythoncited by 1
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Softwarecited by 1
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Datasetcited by 0
- 2026Teaching LLMs Program Semantics via Symbolic Execution Tracescited by 0
- 2026Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Studycited by 0
- 2026SecDrift: Measuring Sector-Conditioned Security Drift in AI-Generated Codecited by 0
- 2026Activation Probes Surface Code-Security Signals that the Model's Output Missescited by 0
- 2026Activation Probes Surface Code-Security Signals that the Model's Output Misses10 Aug 2026
- 2026SecDrift: Measuring Sector-Conditioned Security Drift in AI-Generated Code28 Jul 2026
- 2026Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Study13 Jul 2026
- 2026Teaching LLMs Program Semantics via Symbolic Execution Traces7 May 2026
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software2 Feb 2026
- 2026SastBench: A Benchmark for Testing Agentic SAST Triage6 Jan 2026
- 2026Adaptive Hierarchical Evaluation of LLMs and SAST tools for CWE Prediction in Python4 Jan 2026
- 2025You Have Been LaTeXpOsEd: A Systematic Analysis of Information Leakage in Preprint Archives Using Large Language Models4 Oct 2025
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Dataset28 Aug 2025
- 2025From LLM Reasoning to Autonomous AI Agents: A Comprehensive Review28 Apr 2025