ChamaraVishwajithRajapaksha's picture
Update README.md
65a5bc3 verified
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 snippet
  • cwe β†’ 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"
}