mahdin70 commited on
Commit
3c01459
·
verified ·
1 Parent(s): be455ba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +80 -0
README.md CHANGED
@@ -43,3 +43,83 @@ configs:
43
  - split: test
44
  path: data/test-*
45
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  - split: test
44
  path: data/test-*
45
  ---
46
+
47
+
48
+ # bigvul_primevul_cwe_enriched
49
+
50
+ This dataset is a processed and enriched version of the **BigVul and PrimeVul datasets**, enhanced using CWE mappings from [MITRE's CWE Database](https://cwe.mitre.org/). The purpose of this dataset is to provide a cleaner, more balanced, and more informative version of the original datasets for vulnerability prediction and CWE classification tasks.
51
+
52
+
53
+ ## 📌 Dataset Description
54
+
55
+ This dataset contains vulnerability information from BigVul and PrimeVul datasets, with additional columns added from CWE ID mappings fetched from MITRE’s CWE database. The dataset was cleaned, balanced, and split into **training, validation, and test sets** while maintaining:
56
+ - The distribution ratio of vulnerable and non-vulnerable functions.
57
+ - The distribution ratio of each CWE ID across all splits.
58
+
59
+ ### 💡 Key Features:
60
+ - **Project & Commit Information:** Metadata related to the project and its commits.
61
+ - **Function Code (`func`):** The code snippet associated with each entry.
62
+ - **Vulnerability Label (`vul`):** Whether the function is vulnerable (`1`) or not (`0`).
63
+ - **CVE ID & CWE ID Mapping:** Relevant IDs for categorizing vulnerabilities.
64
+ - **CWE Information:** Additional information fetched from MITRE's CWE database including:
65
+ - `CWE Name`
66
+ - `CWE Description`
67
+ - `Potential Mitigation`
68
+
69
+ ## 📂 Dataset Structure
70
+
71
+ The dataset consists of the following columns:
72
+ | Column Name | Description |
73
+ |-----------------------|----------------------------------------------------------------|
74
+ | project | The name of the project where the code is taken from. |
75
+ | commit_id | The unique commit identifier. |
76
+ | func | The function code snippet. |
77
+ | vul | Label indicating if the function is vulnerable (`1`) or not (`0`). |
78
+ | CVE ID | The CVE identifier (if applicable). |
79
+ | CWE ID | The CWE identifier corresponding to the vulnerability. |
80
+ | CWE Name | The name of the CWE ID. |
81
+ | CWE Description | Description of the CWE category. |
82
+ | Potential Mitigation | Recommended mitigations for addressing the vulnerability. |
83
+
84
+
85
+
86
+ ## 📊 CWE IDs Contained In This Dataset
87
+
88
+ The dataset contains the following **13 unique CWE IDs (Including Not Applicable)**:
89
+
90
+ | CWE ID | CWE Name |
91
+ |-----------|-------------------------------------|
92
+ | CWE-119 | Improper Restriction of Operations within the Bounds of a Memory Buffer |
93
+ | CWE-20 | Improper Input Validation |
94
+ | CWE-125 | Out-of-bounds Read |
95
+ | CWE-399 | Resource Management Errors |
96
+ | CWE-200 | Information Exposure |
97
+ | CWE-787 | Out-of-bounds Write |
98
+ | CWE-264 | Permissions, Privileges, and Access Control |
99
+ | CWE-416 | Use After Free |
100
+ | CWE-476 | NULL Pointer Dereference |
101
+ | CWE-190 | Integer Overflow or Wraparound |
102
+ | CWE-189 | Numeric Errors |
103
+ | CWE-362 | Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) |
104
+ | NOT_APPLICABLE | Not applicable / No CWE ID assigned |
105
+
106
+
107
+ ## 🔍 Data Splitting & Balancing
108
+
109
+ The dataset has been split into **training, validation, and test sets** using stratified sampling to ensure the distribution of:
110
+ 1. Vulnerable (`vul = 1`) and Non-Vulnerable (`vul = 0`) functions.
111
+ 2. Each CWE ID remains consistent across splits.
112
+
113
+
114
+ ## 📥 Usage
115
+
116
+ To load this dataset from the Hugging Face Hub:
117
+ ```python
118
+ from datasets import load_dataset
119
+
120
+ dataset = load_dataset('mahdin70/bigvul_primevul_cwe_enriched')
121
+ ```
122
+
123
+
124
+ ## 📌 Citation
125
+ If you use this dataset, please cite the original sources of BigVul and PrimeVul datasets.