metadata
license: mit
tags:
- security
- cwe
- vulnerability
- code-analysis
- software-security
- dataset
- machine-learning
- llm-finetuning
π Code Vulnerability Dataset (CWE-Enriched)
π Overview
This dataset is built from the bstee615/diversevul dataset and enhanced with structured vulnerability intelligence from the MITRE Common Weakness Enumeration (CWE) database.
It provides a rich, machine-readable representation of software vulnerabilities, mapping raw vulnerable code samples to standardized CWE classifications.
The dataset is designed for research and development in:
- Vulnerability detection models
- Secure code generation
- LLM fine-tuning for cybersecurity tasks
- Static analysis and code understanding systems
π§ Dataset Enrichment Process
Each sample in the dataset has been augmented using the MITRE CWE API to include structured security intelligence such as:
- CWE identifier (e.g., CWE-787)
- Vulnerability type (e.g., Out-of-bounds Write)
- Human-readable description
- Severity / exploit likelihood
- Impact categories (e.g., code execution, crash)
- Applicable programming languages
- Security classification metadata
π Data Structure
Each row in the dataset contains:
πΉ Original Fields
funcβ Source code snippetcweβ Original CWE labels from DiverseVul dataset
πΉ Enriched Field
cwe_detailsβ JSON object containing structured CWE metadata:
{
"cwe_id": "CWE-787",
"vulnerability_type": "Out-of-bounds Write",
"description": "The product writes data past the end, or before the beginning, of the intended buffer.",
"severity": "High",
"category": "Memory Corruption",
"impact": [
"Modify Memory",
"Execute Unauthorized Code",
"Crash (DoS)"
],
"languages": ["C", "C++"],
"example": "Example not extracted"
}