LorenzoNava commited on
Commit
cbc403b
·
verified ·
1 Parent(s): e10dbc3

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +144 -31
README.md CHANGED
@@ -1,31 +1,144 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: ID
5
- dtype: int64
6
- - name: CVE-ID
7
- dtype: string
8
- - name: CVSS-V4
9
- dtype: float64
10
- - name: CVSS-V3
11
- dtype: float64
12
- - name: CVSS-V2
13
- dtype: float64
14
- - name: SEVERITY
15
- dtype: string
16
- - name: DESCRIPTION
17
- dtype: string
18
- - name: CWE-ID
19
- dtype: string
20
- splits:
21
- - name: train
22
- num_bytes: 86079915
23
- num_examples: 225144
24
- download_size: 29034737
25
- dataset_size: 86079915
26
- configs:
27
- - config_name: default
28
- data_files:
29
- - split: train
30
- path: data/train-*
31
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CVE-CWE Dataset (Cleaned)
2
+
3
+ Cleaned version of the CVE-CWE dataset with only standard CWE classifications.
4
+
5
+ ## Dataset Source
6
+
7
+ **Original Dataset:** [stasvinokur/cve-and-cwe-dataset-1999-2025](https://huggingface.co/datasets/stasvinokur/cve-and-cwe-dataset-1999-2025)
8
+
9
+ This dataset contains CVE (Common Vulnerabilities and Exposures) descriptions paired with their corresponding CWE (Common Weakness Enumeration) classifications from 1999-2025.
10
+
11
+ ## Cleaning Process
12
+
13
+ The original dataset contained **280,694 samples**. We performed the following cleaning:
14
+
15
+ ### 1. Removed Non-Standard Classifications
16
+ - **Removed:** 55,550 samples (19.79%) labeled as `"NVD-CWE-Other"`
17
+ - **Reason:** "NVD-CWE-Other" is a catch-all category, not a specific weakness classification
18
+
19
+ ### 2. Removed Missing Values
20
+ - **Removed:** Samples with null or empty `CWE-ID` values
21
+ - **Reason:** Cannot train on samples without target labels
22
+
23
+ ### 3. Validated CWE Format
24
+ - **Kept:** Only samples matching pattern `CWE-XXXX` (where XXXX is numeric)
25
+ - **Example valid:** `CWE-79`, `CWE-119`, `CWE-89`
26
+ - **Example removed:** `NVD-CWE-Other`, `null`, `""`
27
+
28
+ ## Dataset Statistics
29
+
30
+ | Metric | Value |
31
+ |--------|-------|
32
+ | **Total samples** | 225,144 |
33
+ | **Unique CWE classes** | 695 |
34
+ | **Removed samples** | 55,550 (19.79% of original) |
35
+ | **Time range** | 1999-2025 |
36
+ | **Language** | English |
37
+
38
+ ## Dataset Structure
39
+
40
+ ```python
41
+ {
42
+ "DESCRIPTION": str, # CVE vulnerability description
43
+ "CWE-ID": str, # CWE classification (e.g., "CWE-79")
44
+ }
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ ```python
50
+ from datasets import load_dataset
51
+
52
+ # Load cleaned dataset
53
+ dataset = load_dataset("LorenzoNava/cve-cwe-dataset-cleaned")
54
+
55
+ # Example
56
+ print(dataset['train'][0])
57
+ # {
58
+ # 'DESCRIPTION': 'A buffer overflow in the web server...',
59
+ # 'CWE-ID': 'CWE-119'
60
+ # }
61
+ ```
62
+
63
+ ## Top 10 Most Common CWEs
64
+
65
+ (Statistics will be updated)
66
+
67
+ 1. CWE-79 - Cross-site Scripting (XSS)
68
+ 2. CWE-119 - Buffer Errors
69
+ 3. CWE-200 - Information Exposure
70
+ 4. CWE-20 - Improper Input Validation
71
+ 5. CWE-89 - SQL Injection
72
+ 6. CWE-264 - Permissions, Privileges, and Access Controls
73
+ 7. CWE-399 - Resource Management Errors
74
+ 8. CWE-287 - Improper Authentication
75
+ 9. CWE-352 - Cross-Site Request Forgery (CSRF)
76
+ 10. CWE-22 - Path Traversal
77
+
78
+ ## Comparison with Original Dataset
79
+
80
+ | Aspect | Original | Cleaned |
81
+ |--------|----------|---------|
82
+ | **Samples** | 280,694 | 225,144 |
83
+ | **CWE classes** | 696 | 695 |
84
+ | **Includes "NVD-CWE-Other"** | ✅ Yes | ❌ No |
85
+ | **Only standard CWEs** | ❌ No | ✅ Yes |
86
+ | **Best for** | Research, analysis | Training ML models |
87
+
88
+ ## Use Cases
89
+
90
+ ### ✅ Recommended For:
91
+ - Training CWE classification models
92
+ - Building automated vulnerability assessment tools
93
+ - Researching CWE distribution patterns
94
+ - Developing security ML applications
95
+
96
+ ### ❌ Not Recommended For:
97
+ - Analyzing "unknown" or uncategorized vulnerabilities
98
+ - Studies requiring complete historical data
99
+ - Research on NVD categorization practices
100
+
101
+ For these use cases, use the [original dataset](https://huggingface.co/datasets/stasvinokur/cve-and-cwe-dataset-1999-2025) instead.
102
+
103
+ ## Data Quality
104
+
105
+ - ✅ All samples have valid CWE-ID
106
+ - ✅ All CWE-IDs follow standard format (CWE-XXXX)
107
+ - ✅ No duplicate removal (preserves all valid samples)
108
+ - ✅ No text preprocessing (original CVE descriptions preserved)
109
+
110
+ ## Citation
111
+
112
+ If you use this dataset, please cite:
113
+
114
+ ```bibtex
115
+ @dataset{cve-cwe-cleaned-2024,
116
+ author = {Berghem - Smart Information Security},
117
+ title = {CVE-CWE Dataset (Cleaned)},
118
+ year = {2024},
119
+ publisher = {Hugging Face},
120
+ url = {https://huggingface.co/datasets/LorenzoNava/cve-cwe-dataset-cleaned},
121
+ note = {Cleaned version of stasvinokur/cve-and-cwe-dataset-1999-2025}
122
+ }
123
+ ```
124
+
125
+ **Original dataset citation:**
126
+ ```bibtex
127
+ @dataset{cve-cwe-original-2025,
128
+ author = {Vinokur, Stas},
129
+ title = {CVE and CWE Dataset 1999-2025},
130
+ year = {2025},
131
+ publisher = {Hugging Face},
132
+ url = {https://huggingface.co/datasets/stasvinokur/cve-and-cwe-dataset-1999-2025}
133
+ }
134
+ ```
135
+
136
+ ## License
137
+
138
+ Same license as original dataset.
139
+
140
+ ## Developed By
141
+
142
+ **Berghem - Smart Information Security**
143
+
144
+ For questions or issues, visit the [dataset repository](https://huggingface.co/datasets/LorenzoNava/cve-cwe-dataset-cleaned).