Published April 25, 2026 | Version v1

A Benchmark Dataset for Code-Level Vulnerability Detection and Analysis

Contributors

  • 1. Deapartment of CSE
  • 2. Oakaland University
  • 3. ROR icon Oakland University

Description

We present PyCode_Vul, a Python-based software vulnerability dataset constructed from 15 open-source GitHub projects. The corpus comprises 17,811 function-level instances, including 7,899 vulnerable and 9,912 non-vulnerable samples. Our pipeline mines commit histories, extracts code changes, and recovers complete functions with AST-validated parsing. Labels are assigned via CWE mapping that combines heuristic patterns with the Bandit static analysis tool, followed by rigorous deduplication to reduce leakage and near-duplicates. We benchmark ten large language models (LLMs) on PyCode_Vul and evaluate cross-dataset generalization on CVEfixes, VUDENC, PyData, Cod_Vulnerability_Python, Buggy_Python, and PCV+Merge, alongside our PyCode_Vul Test split. Results indicate that UniXcoder and CodeT5+ consistently achieve the best overall performance on our proposed test set and the merged split, indicating that PyCode_Vul exhibits a coherent, learnable distribution for LLM-based vulnerability detection. 

Files

overview.jpg

Files (92.9 MB)

Name Size Download all
md5:9b8a52a03fc16b2e6d8b645cc1a6f61a
419.5 kB Preview Download
md5:77e72de497b31054466f92bc3c6aee9d
19.8 MB Preview Download
md5:7538117c1224cc15a028981efd6b00c9
72.6 MB Preview Download

Additional details

Dates

Available
2026-04-24

Software

Repository URL
https://huggingface.co/datasets/S-AIR-L/PyCode-Vul
Programming language
Python
Development Status
Active

References

  • @inproceedings{karim2025benchmark, title={A Benchmark Dataset for Code-Level Vulnerability Detection and Analysis}, author={Karim, Tasmin and Akter, Mst Shapna and Cuzzocrea, Alfredo}, booktitle={2025 IEEE International Conference on Big Data (BigData)}, pages={4237--4246}, year={2025}, organization={IEEE} }