A Benchmark Dataset for Code-Level Vulnerability Detection and Analysis
Authors/Creators
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
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} }