Datasets:

Modalities:
Text
Formats:
parquet
cedricbonhomme's picture
Update README.md
217864d verified
|
raw
history blame
2.79 kB
metadata
dataset_info:
  features:
    - name: id
      dtype: string
    - name: title
      dtype: string
    - name: description
      dtype: string
    - name: patches
      list:
        - name: commit_message
          dtype: string
        - name: patch_text_b64
          dtype: string
        - name: url
          dtype: string
    - name: cwe
      dtype: string
  splits:
    - name: train
      num_bytes: 1476788282
      num_examples: 14252
    - name: test
      num_bytes: 164133640
      num_examples: 1584
  download_size: 725386804
  dataset_size: 1640921922
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: test
        path: data/test-*

This dataset, CIRCL/vulnerability-cwe-patch, provides structured real-world vulnerabilities enriched with CWE identifiers and actual patches from platforms like GitHub and GitLab. It was built to support the development of tools for vulnerability classification, triage, and automated repair. Each entry includes metadata such as CVE/GHSA ID, a description, CWE categorization, and links to verified patch commits with associated diff content and commit messages.

The dataset is automatically extracted using a robust pipeline that fetches vulnerability records from several sources, filters out entries without patches, and verifies patch links for accessibility. Extracted patches are fetched, encoded in base64, and stored alongside commit messages for training and evaluation of ML models. Source Data

The dataset comprises 15,836 vulnerabilities and 18,435 associated patches. For training, we consider only those patches corresponding to vulnerabilities annotated with at least one CWE.

The vulnerabilities are sourced from:

- NVD CVE List — enriched with commit references

- GitHub Security Advisories (GHSA)

- GitLab advisories

- CSAF feeds from vendors including Red Hat, Cisco, and CISA

Schema

Each example contains:

- id: Vulnerability identifier (e.g., CVE-2023-XXXX, GHSA-XXXX)

- title: Human-readable title of the vulnerability

- description: Detailed vulnerability description

- patches: List of patch records, each with:

    url: Verified patch URL (GitHub/GitLab)

    patch_text_b64: Base64-encoded unified diff

    commit_message: Associated commit message

- cwe: List of CWE identifiers and names

Use Cases

The dataset supports a range of security-focused machine learning tasks:

* Vulnerability classification

* CWE prediction from descriptions

* Patch generation from natural language

* Commit message understanding

Associated Code

The dataset is generated with the extraction pipeline from vulnerability-lookup/ML-Gateway, which includes logic for fetching, filtering, validating, and encoding patch data.