Team Ai
Datasetpublic

ChamaraVishwajithRajapaksha/Code_Vulnerability_Dataset

πŸ” 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… See the full description on the dataset page: https://huggingface.co/datasets/ChamaraVishwajithRajapaksha/Code_Vulnerability_Dataset.

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes32downloads
Dataset Card

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 snippet
  • β€”cwe β†’ Original CWE labels from DiverseVul dataset

πŸ”Ή Enriched Field

  • β€”cwe_details β†’ JSON object containing structured CWE metadata:
json
{
  "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"
}