mlsanityData to 7 Oct 2026

CASTLE: Benchmarking Dataset for Static Code Analyzers and LLMs towards CWE Detection

arXiv 2503.09433 ↗First posted 12 Mar 2025cs.CR cs.AI cs.SEcited by 10

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

  1. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  2. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
  3. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
  4. 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
  5. 2023InferFix: End-to-End Program Repair with LLMscited by 113
  6. 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 100
  7. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
  8. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
  9. 2023A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verificationcited by 42
  10. 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 23
  11. 2024LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitationscited by 21
  12. 2024DLAP: A Deep Learning Augmented Large Language Model Prompting Framework for Software Vulnerability Detectioncited by 13
1 more
  1. 2024Improving LLM Classification of Logical Errors by Integrating Error Relationship into Promptscited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 3; 2026: 7.

10 papers.