File size: 3,977 Bytes
d825fb3 1a2f92f d825fb3 1a2f92f d825fb3 1a2f92f d825fb3 1a2f92f 10de707 1a2f92f 10de707 1a2f92f d825fb3 1a2f92f d825fb3 0408bfc 10de707 0408bfc d825fb3 10de707 d825fb3 2804d78 4075d7d 630a5eb 2804d78 630a5eb 2804d78 630a5eb 217864d 95f6673 66a0477 95f6673 2804d78 3a8ab37 2804d78 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
---
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: 4405036770
num_examples: 35334
- name: test
num_bytes: 489448530
num_examples: 3926
download_size: 2239993030
dataset_size: 4894485300
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: test
path: data/test-*
---
### Description
This dataset, CIRCL/vulnerability-cwe-patch, provides structured, real-world vulnerabilities enriched with CWE identifiers and corresponding patches from platforms like GitHub and GitLab. It is designed to support the development of tools for vulnerability classification, triage, and automated remediation. 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 via a pipeline that fetches vulnerability records from multiple sources, filters out entries without patches, and verifies the accessibility of patch links. Patches are then fetched, base64-encoded, and stored alongside commit messages for the training and evaluation of machine learning models.
The dataset consists of 39,260 vulnerabilities and **49,001 associated patches**. For training purposes, only patches corresponding to vulnerabilities annotated with at least one CWE are considered.
### How to use with datasets
```python
>>> import json
>>> from datasets import load_dataset
>>> dataset = load_dataset("CIRCL/vulnerability-cwe-patch")
>>> vulnerabilities = ["CVE-2025-60249", "CVE-2025-32413"]
>>> filtered_entries = dataset.filter(lambda elem: elem["id"] in vulnerabilities)
>>> for entry in filtered_entries["train"]:
... print(entry["cwe"])
... for patch in entry["patches"]:
... print(f" {patch['commit_message']}")
...
CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting')
[PATCH] fix: [security] Fixed a stored XSS vulnerability in user bios. Thanks to Dawid Czarnecki for reporting the issue.
CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting')
[PATCH] fix: [security] sanitize user input in comments, bundles, and sightings - Escaped untrusted data in templates and tables to prevent XSS - Replaced unsafe innerHTML assignments with createElement/textContent - Encoded dynamic URLs using encodeURIComponent - Improved validation in Comment, Bundle, and Sighting models Credit: @Wachizungu
```
### 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
The vulnerabilities can be 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
### 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. |