Remove README.md as requested
Browse files
README.md
DELETED
|
@@ -1,110 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
# YAML Metadata Block
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
-
tags:
|
| 6 |
-
- vulnerability-detection
|
| 7 |
-
- cve
|
| 8 |
-
- code-changes
|
| 9 |
-
- software-security
|
| 10 |
-
license: mit
|
| 11 |
-
dataset_info:
|
| 12 |
-
features:
|
| 13 |
-
- name: CVE_ID
|
| 14 |
-
dtype: string
|
| 15 |
-
- name: CWE_ID
|
| 16 |
-
dtype: string
|
| 17 |
-
- name: Score
|
| 18 |
-
dtype: float
|
| 19 |
-
- name: Summary
|
| 20 |
-
dtype: string
|
| 21 |
-
- name: commit_id
|
| 22 |
-
dtype: string
|
| 23 |
-
- name: codeLink
|
| 24 |
-
dtype: string
|
| 25 |
-
- name: file_name
|
| 26 |
-
dtype: string
|
| 27 |
-
- name: func_after
|
| 28 |
-
dtype: string
|
| 29 |
-
- name: lines_after
|
| 30 |
-
dtype: string
|
| 31 |
-
dataset_size: 10GB
|
| 32 |
-
---
|
| 33 |
-
|
| 34 |
-
# MSR Data Cleaned - C/C++ Code Vulnerability Dataset
|
| 35 |
-
|
| 36 |
-
[](LICENSE)
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
## ๐ Dataset Description
|
| 41 |
-
A curated collection of C/C++ code vulnerabilities paired with:
|
| 42 |
-
- CVE details (scores, classifications, exploit status)
|
| 43 |
-
- Code changes (commit messages, added/deleted lines)
|
| 44 |
-
- File-level and function-level diffs
|
| 45 |
-
|
| 46 |
-
## ๐ Sample Data Structure
|
| 47 |
-
```python
|
| 48 |
-
+---------------+-----------------+----------------------+---------------------------+
|
| 49 |
-
| CVE ID | Attack Origin | Publish Date | Summary |
|
| 50 |
-
+===============+=================+======================+===========================+
|
| 51 |
-
| CVE-2015-8467 | Remote | 2015-12-29 | "The samldb_check_user..."|
|
| 52 |
-
+---------------+-----------------+----------------------+---------------------------+
|
| 53 |
-
| CVE-2016-1234 | Local | 2016-01-15 | "Buffer overflow in..." |
|
| 54 |
-
+---------------+-----------------+----------------------+---------------------------+
|
| 55 |
-
```
|
| 56 |
-
|
| 57 |
-
## ๐ ๏ธ Usage Instructions
|
| 58 |
-
|
| 59 |
-
### 1. Accessing in Colab
|
| 60 |
-
```python
|
| 61 |
-
!pip install huggingface_hub -q
|
| 62 |
-
from huggingface_hub import snapshot_download
|
| 63 |
-
|
| 64 |
-
repo_id = "starsofchance/MSR_data_cleaned"
|
| 65 |
-
dataset_path = snapshot_download(repo_id=repo_id, repo_type="dataset")
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
### 2. Extracting the Dataset
|
| 69 |
-
```python
|
| 70 |
-
!apt-get install unzip -qq
|
| 71 |
-
!unzip "/root/.cache/huggingface/.../MSR_data_cleaned.zip" -d "/content/extracted_data"
|
| 72 |
-
```
|
| 73 |
-
**Note:** Extracted size is **10GB** (1.5GB compressed).
|
| 74 |
-
|
| 75 |
-
### 3. Creating Splits (Colab Pro Recommended)
|
| 76 |
-
We used this memory-efficient approach:
|
| 77 |
-
```python
|
| 78 |
-
from datasets import load_dataset
|
| 79 |
-
dataset = load_dataset("csv", data_files="MSR_data_cleaned.csv", streaming=True)
|
| 80 |
-
|
| 81 |
-
# Randomly distribute rows (80-10-10)
|
| 82 |
-
for row in dataset:
|
| 83 |
-
rand = random.random()
|
| 84 |
-
if rand < 0.8: write_to(train.csv)
|
| 85 |
-
elif rand < 0.9: write_to(validation.csv)
|
| 86 |
-
else: write_to(test.csv)
|
| 87 |
-
```
|
| 88 |
-
**Hardware Requirements:**
|
| 89 |
-
- Minimum 25GB RAM
|
| 90 |
-
- Strong CPU (Colab Pro T4 GPU recommended)
|
| 91 |
-
|
| 92 |
-
## ๐ Citation
|
| 93 |
-
```bibtex
|
| 94 |
-
@inproceedings{fan2020ccode,
|
| 95 |
-
title={A C/C++ Code Vulnerability Dataset with Code Changes and CVE Summaries},
|
| 96 |
-
author={Fan, Jiahao and Li, Yi and Wang, Shaohua and Nguyen, Tien N},
|
| 97 |
-
booktitle={MSR '20: 17th International Conference on Mining Software Repositories},
|
| 98 |
-
pages={1--5},
|
| 99 |
-
year={2020},
|
| 100 |
-
doi={10.1145/3379597.3387501}
|
| 101 |
-
}
|
| 102 |
-
```
|
| 103 |
-
|
| 104 |
-
## ๐ Dataset Creation
|
| 105 |
-
- **Source**: Original data from [MSR 2020 Paper](https://doi.org/10.1145/3379597.3387501)
|
| 106 |
-
- **Processing**:
|
| 107 |
-
- Cleaned and standardized CSV format
|
| 108 |
-
- Stream-based splitting to handle large size
|
| 109 |
-
- Preserved all original metadata
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|