File size: 7,345 Bytes
0c32abb
 
 
 
 
 
 
 
e813793
 
0c32abb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e813793
0c32abb
e813793
 
0c32abb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1f60f6
 
0c32abb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
license: mit
dataset_info:
  features:
  - name: idx
    dtype: int64
  - name: project
    dtype: string
  - name: project_url
    dtype: string
  - name: filepath
    dtype: string
  - name: commit_id
    dtype: string
  - name: commit_message
    dtype: string
  - name: is_vulnerable
    dtype: bool
  - name: hash
    dtype: string
  - name: func_name
    dtype: string
  - name: func_body
    dtype: string
  - name: changed_lines
    dtype: string
  - name: changed_statements
    dtype: string
  - name: cve_list
    sequence: string
  - name: cwe_list
    sequence: string
  - name: fixed_func_idx
    dtype: int64
  - name: context
    struct:
    - name: Execution Environment
      sequence: string
    - name: Explanation
      sequence: string
    - name: External Function
      sequence: string
    - name: Function Argument
      sequence: string
    - name: Globals
      sequence: string
    - name: Type Execution Declaration
      sequence: string
  splits:
  - name: train
    num_bytes: 119514243
    num_examples: 25440
  download_size: 30875803
  dataset_size: 119514243
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

# Dataset Card for Dataset Name

SecVulEval is a collection of real-world C/C++ vulnerabilities.

## Dataset Details

### Dataset Description
The dataset is curated by collecting C/C++ vulnerability from NVD. It features statement-level vulnerable information, context information for vulnerable functions 
(`is_vulnerable=True`), and other metadata such as CVE, CWE, commit information. The dataset contains vulnerable and non-vulnerable function samples.

<!-- - **Curated by:** [More Information Needed]
- **Funded by [optional]:** [More Information Needed]
- **Shared by [optional]:** [More Information Needed]
- **Language(s) (NLP):** [More Information Needed]
- **License:** [More Information Needed] -->

### Dataset Sources

The vulnerabilities (CVEs) are collected from NVD (https://nvd.nist.gov). Then, the corresponding patches to the vulnerabilities are collected from their 
respective git repositories.

<!-- - **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed] -->

## Uses

The dataset comprises both vulnerable (43.23%) and non-vulnerable (56.77%) functions, with a total collection of 25,440 function. This large collection of functions make
it suitable for training vulnerability detection model. The statement-level info, along with contextual information can make context-aware detection at finer-grained
level possible. The dataset can also be used to evaluate C/C++ vulnerability detection models.

<!-- ### Direct Use

<!-- This section describes suitable use cases for the dataset. -->

<!-- [More Information Needed] -->

<!-- ### Out-of-Scope Use

<!-- This section addresses misuse, malicious use, and uses that the dataset will not work well for. -->

<!-- [More Information Needed] -->

## Dataset Structure

The dataset has 15 different fields.
- The `project_url` column has 735 different values while the `project` column has 707 unique values.
This is because for `project == "Android"`, there are multiple different repositories.
- The `changed_lines` and `changed_statements` columns include the changes in made in the patch as a list of (line, code) pair. 
Vulnerable functions include the deleted lines/statements and the non-vulnerable functions has the added lines/statements.
- Some functions/vulnerabilities can be assigned to more than one CVE/CWE which is why `cve_list` and `cwe_list` are given as lists, although in most cases there would be
only one CVE and CWE id.
- The `fixed_func_id` includes the `idx` number (first field in the dataset) of the corresponding fixed patch of a vulnerable function. This helps to easily pair the 
vulnerable functions with their fixing code. For non-vulnerable code it doesn't make sense for a "fixed" version and the `fixed_func_id` is just itself.
- The `context` field includes contextual information for vulnerable functions according to the five categories as discussed in the paper. It is added as the list of
symbols and an explanation as generated by the LLM.

Other fields are self-explanatory. 

<!-- [More Information Needed]

## Dataset Creation

### Curation Rationale

<!-- Motivation for the creation of this dataset. -->

<!-- [More Information Needed] -->

<!-- ### Source Data -->

<!-- This section describes the source data (e.g. news text and headlines, social media posts, translated sentences, ...). -->

<!-- #### Data Collection and Processing -->

<!-- This section describes the data collection and processing process such as data selection criteria, filtering and normalization methods, tools and libraries used, etc. -->

<!-- [More Information Needed] -->

<!-- #### Who are the source data producers? -->

<!-- This section describes the people or systems who originally created the data. It should also include self-reported demographic or identity information for the source data creators if this information is available. -->

<!-- [More Information Needed] -->

<!-- ### Annotations [optional]

<!-- If the dataset contains annotations which are not part of the initial data collection, use this section to describe them. -->

<!-- #### Annotation process -->

<!-- This section describes the annotation process such as annotation tools used in the process, the amount of data annotated, annotation guidelines provided to the annotators, interannotator statistics, annotation validation, etc. -->

<!-- [More Information Needed] -->

<!-- #### Who are the annotators?

<!-- This section describes the people or systems who created the annotations. -->

<!-- [More Information Needed] -->

<!-- #### Personal and Sensitive Information

<!-- State whether the dataset contains data that might be considered personal, sensitive, or private (e.g., data that reveals addresses, uniquely identifiable names or aliases, racial or ethnic origins, sexual orientations, religious beliefs, political opinions, financial or health data, etc.). If efforts were made to anonymize the data, describe the anonymization process. -->

<!-- [More Information Needed] -->

<!-- ## Bias, Risks, and Limitations -->

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

<!-- [More Information Needed] -->

<!-- ### Recommendations -->

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

<!-- Users should be made aware of the risks, biases and limitations of the dataset. More information needed for further recommendations. -->

<!-- ## Citation [optional] -->

<!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->

<!-- **BibTeX:**

[More Information Needed]

**APA:**

[More Information Needed] -->

<!-- ## Glossary [optional] -->

<!-- If relevant, include terms and calculations in this section that can help readers understand the dataset or dataset card. -->

<!-- [More Information Needed]

## More Information [optional]

[More Information Needed] -->

<!-- ## Dataset Card Authors [optional]

[More Information Needed]

## Dataset Card Contact

[More Information Needed] -->