Exploit Intel commited on
Commit
b484f66
·
verified ·
1 Parent(s): b0a174b

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +99 -0
README.md CHANGED
@@ -1,4 +1,19 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: messages
@@ -29,3 +44,87 @@ configs:
29
  - split: test
30
  path: data/test-*
31
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+ task_categories:
6
+ - text-classification
7
+ - text-generation
8
+ tags:
9
+ - cybersecurity
10
+ - cve
11
+ - cwe
12
+ - vulnerability
13
+ - security
14
+ pretty_name: CVE-to-CWE Consensus
15
+ size_categories:
16
+ - 100K<n<1M
17
  dataset_info:
18
  features:
19
  - name: messages
 
44
  - split: test
45
  path: data/test-*
46
  ---
47
+
48
+ # CVE-to-CWE Consensus Dataset
49
+
50
+ A multi-label dataset mapping **CVE vulnerability descriptions** to their **CWE weakness type(s)**, built for fine-tuning instruction-tuned LLMs (e.g. with [Unsloth](https://unsloth.ai)). Each label is a **consensus** assignment: a CWE is kept only when **NVD and the CVE Numbering Authority (CNA) independently agree** on it, after rolling both up to **CWE View-1003** (the ~130-weakness "Weaknesses for Simplified Mapping of Published Vulnerabilities").
51
+
52
+ ## TL;DR
53
+
54
+ - **Task:** given a CVE description, predict the CWE ID(s) — multi-label.
55
+ - **116,793 examples** — train 91,862 / validation 13,705 / test 11,226.
56
+ - **Format:** conversational `messages` (system / user / assistant), ready for chat-template SFT.
57
+ - **Trust model:** labels are the **intersection** of two independent official sources (NVD + CNA), so single-source errors are excluded by construction.
58
+
59
+ ## Example row
60
+
61
+ ```json
62
+ {"messages": [
63
+ {"role": "system", "content": "You are a vulnerability analyst. Given a CVE description, reply with only the CWE ID(s) it maps to, comma-separated."},
64
+ {"role": "user", "content": "A reflected cross-site scripting issue in Acme Portal lets a remote attacker inject arbitrary script via the q parameter."},
65
+ {"role": "assistant", "content": "CWE-79"}
66
+ ]}
67
+ ```
68
+
69
+ Multi-label targets are comma-separated and numerically sorted, e.g. `"CWE-79, CWE-352"`. The model input is the **description only** — CVE IDs and source label fields are never included, to avoid memorization/leakage.
70
+
71
+ ## How it was built
72
+
73
+ 1. **Sources (official upstreams only):**
74
+ - [NVD CVE API 2.0](https://nvd.nist.gov/developers/vulnerabilities) — analyst-assigned CWEs (`weaknesses`).
75
+ - [CVEProject/cvelistV5](https://github.com/CVEProject/cvelistV5) — CNA-supplied CWEs (`problemTypes`) and the English description.
76
+ - [MITRE CWE](https://cwe.mitre.org) catalog (v4.20) — View-1003 membership + the `ChildOf` hierarchy.
77
+ 2. **Roll-up:** every assigned CWE is rolled up to its nearest View-1003 mapping ancestor(s).
78
+ 3. **Consensus:** the label is the **intersection** of NVD's and the CNA's rolled-up CWE sets; CVEs with no agreement are dropped.
79
+ 4. **Filtering:** REJECTED/DISPUTED CVEs, non-English and too-short (<40 char) descriptions are dropped; pseudo-labels (`NVD-CWE-noinfo`/`-Other`) are excluded.
80
+ 5. **De-duplication:** near-duplicate descriptions (MinHash, Jaccard ≥ 0.7) are grouped into families, and **whole families stay within a single split**, so near-identical text cannot leak across train/validation/test (verified: 0 shared descriptions across splits).
81
+ 6. **Split:** dedup-family-aware, ~80/10/10.
82
+
83
+ ## Provenance (reproducibility)
84
+
85
+ | Source | Version |
86
+ |---|---|
87
+ | cvelistV5 | commit `7f860dcfb8260ccff2f23b4b5f685303fd314f17` |
88
+ | NVD | pulled 2026-05-29 |
89
+ | MITRE CWE | v4.20 |
90
+
91
+ ## Statistics
92
+
93
+ - **Keep rate:** 116,793 of 354,163 scanned CVEs (~33%); most drops are "no consensus" (sources disagreed, or only one assigned a CWE).
94
+ - **Recency skew:** consensus concentrates on **2023+** CVEs, because that is when CNAs began reliably populating CWE — this is the main coverage bias.
95
+ - **Label space:** 127 distinct View-1003 CWEs appear in the consensus set; a minimum-examples floor (50) prunes the rarest, leaving ~117 effective labels. The distribution is long-tailed (CWE-79 most common).
96
+ - **Cardinality:** most examples carry a single label; ~14% carry two or more.
97
+
98
+ ## Intended use
99
+
100
+ Fine-tuning or evaluating models that classify CVE descriptions into CWE types (vulnerability triage, enrichment, prioritization aids). Held-out `test` is intended for measuring multi-label performance (e.g. exact-match and micro/macro F1).
101
+
102
+ ## Limitations & biases
103
+
104
+ - **Recency-skewed (2023+)** — weaker coverage of older CVE styles.
105
+ - **Consensus is high-precision, not exhaustive** — CVEs where the two sources disagree (often genuinely ambiguous) are excluded, so this set is "cleaner/easier" than the full CVE population.
106
+ - **Roll-up to View-1003** discards sub-View-1003 specificity (variant-level CWEs map to their base).
107
+ - **English only.**
108
+ - Not a substitute for analyst review on novel or complex vulnerabilities.
109
+
110
+ ## License & attribution
111
+
112
+ Released under **CC BY 4.0**. The dataset derives from public sources; please also honor their terms:
113
+
114
+ - **NVD** (NIST) — U.S. Government work, public domain.
115
+ - **CVE Program / cvelistV5** — © the CVE Program; CVE Records are free to use with attribution.
116
+ - **MITRE CWE** — © The MITRE Corporation; free to use with attribution.
117
+
118
+ CWE™ and CVE® are trademarks of The MITRE Corporation.
119
+
120
+ ## Citation
121
+
122
+ ```bibtex
123
+ @misc{cve_cwe_consensus_2026,
124
+ title = {CVE-to-CWE Consensus Dataset},
125
+ author = {eiphuggincve},
126
+ year = {2026},
127
+ howpublished = {Hugging Face Hub},
128
+ url = {https://huggingface.co/datasets/eiphuggincve/cve-cwe-consensus}
129
+ }
130
+ ```