File size: 1,860 Bytes
65a5bc3
4b7f005
65a5bc3
 
 
 
 
 
 
 
 
 
4b7f005
65a5bc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

---
license: mit
tags:
- security
- cwe
- vulnerability
- code-analysis
- software-security
- dataset
- machine-learning
- llm-finetuning
---

# ๐Ÿ” Code Vulnerability Dataset (CWE-Enriched)

## ๐Ÿ“Œ Overview

This dataset is built from the **bstee615/diversevul** dataset and enhanced with structured vulnerability intelligence from the **MITRE Common Weakness Enumeration (CWE)** database.

It provides a rich, machine-readable representation of software vulnerabilities, mapping raw vulnerable code samples to standardized CWE classifications.

The dataset is designed for research and development in:
- Vulnerability detection models
- Secure code generation
- LLM fine-tuning for cybersecurity tasks
- Static analysis and code understanding systems

---

## ๐Ÿง  Dataset Enrichment Process

Each sample in the dataset has been augmented using the MITRE CWE API to include structured security intelligence such as:

- CWE identifier (e.g., CWE-787)
- Vulnerability type (e.g., Out-of-bounds Write)
- Human-readable description
- Severity / exploit likelihood
- Impact categories (e.g., code execution, crash)
- Applicable programming languages
- Security classification metadata

---

## ๐Ÿ“Š Data Structure

Each row in the dataset contains:

### ๐Ÿ”น Original Fields
- `func` โ†’ Source code snippet
- `cwe` โ†’ Original CWE labels from DiverseVul dataset

### ๐Ÿ”น Enriched Field
- `cwe_details` โ†’ JSON object containing structured CWE metadata:

```json
{
  "cwe_id": "CWE-787",
  "vulnerability_type": "Out-of-bounds Write",
  "description": "The product writes data past the end, or before the beginning, of the intended buffer.",
  "severity": "High",
  "category": "Memory Corruption",
  "impact": [
    "Modify Memory",
    "Execute Unauthorized Code",
    "Crash (DoS)"
  ],
  "languages": ["C", "C++"],
  "example": "Example not extracted"
}