Update README.md
Browse files
README.md
CHANGED
@@ -10,14 +10,95 @@ tags:
|
|
10 |
- vulnerability
|
11 |
---
|
12 |
|
13 |
-
#
|
14 |
|
15 |
<!-- Provide a quick summary of the dataset. -->
|
16 |
|
17 |
-
This repository contains the dataset CWE-Bench-Java presented in the paper [LLM-Assisted Static Analysis for Detecting Security Vulnerabilities](https://arxiv.org/abs/2405.17238). At a high level, this dataset contains 120 CVEs spanning 4 CWEs, namely path-traversal, OS-command injection, cross-site scripting, and code-injection.
|
18 |
|
19 |
## Dataset Details
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
### Dataset Description
|
22 |
|
23 |
<!-- Provide a longer summary of what this dataset is. -->
|
|
|
10 |
- vulnerability
|
11 |
---
|
12 |
|
13 |
+
# CWE-Bench-Java
|
14 |
|
15 |
<!-- Provide a quick summary of the dataset. -->
|
16 |
|
17 |
+
This repository contains the dataset CWE-Bench-Java presented in the paper [LLM-Assisted Static Analysis for Detecting Security Vulnerabilities](https://arxiv.org/abs/2405.17238). At a high level, this dataset contains 120 CVEs spanning 4 CWEs, namely path-traversal, OS-command injection, cross-site scripting, and code-injection. Each CVE includes the buggy and fixed source code of the project, along with the information of the fixed files and functions. We provide the seed information for each CVE in this repository, as well as advisories.
|
18 |
|
19 |
## Dataset Details
|
20 |
|
21 |
+
### Project Identifier
|
22 |
+
|
23 |
+
In this dataset, each project is uniquely identified with a **Project Slug**, encompassing its repository name, CVE ID, and a tag corresponding to the buggy version of the project.
|
24 |
+
We show one example below:
|
25 |
+
|
26 |
+
```
|
27 |
+
DSpace__DSpace_CVE-2016-10726_4.4
|
28 |
+
^^^^^^ ^^^^^^ ^^^^^^^^^^^^^^ ^^^
|
29 |
+
| | | |--> Version Tag
|
30 |
+
| | |--> CVE ID
|
31 |
+
| |--> Repository name
|
32 |
+
|--> Github Username
|
33 |
+
```
|
34 |
+
|
35 |
+
All the patches, advisory information, build information, and fix information are associated with project slugs.
|
36 |
+
Since there are 120 projects in the CWE-Bench-Java dataset, we have 120 unique project slugs.
|
37 |
+
Note that a single repository may be found to have different CVEs in different versions.
|
38 |
+
|
39 |
+
### Packaged Data
|
40 |
+
|
41 |
+
```
|
42 |
+
- data/
|
43 |
+
- project_info.csv
|
44 |
+
- build_info.csv
|
45 |
+
- fix_info.csv
|
46 |
+
- advisory/<project_slug>.json
|
47 |
+
```
|
48 |
+
|
49 |
+
The core set of information in this dataset lies in two files, `data/project_info.csv` and `data/fix_info.csv`.
|
50 |
+
We also provide other essential information such as CVE advisory, and build information for the projects.
|
51 |
+
We now go into the project information and fix information CSVs.
|
52 |
+
|
53 |
+
### Project Info
|
54 |
+
|
55 |
+
| id | project_slug | cve_id | cwe_id | cwe_name | github_username | github_repository_name | github_tag | github_url | advisory_id | buggy_commit_id | fix_commit_ids |
|
56 |
+
| -- | ------------ | ------ | -------|----------|-----------------|------------------------|------------|------------|-------------|-----------------|----------------|
|
57 |
+
| 1 | DSpace__DSpace_CVE-2016-10726_4.4 | CVE-2016-10726 | CWE-022 | Path Traversal | DSpace | DSpace | 4.4 | https://github.com/DSpace/DSpace | GHSA-4m9r-5gqp-7j82 | ca4c86b1baa4e0b07975b1da86a34a6e7170b3b7 | 4239abd2dd2ae0dedd7edc95a5c9f264fdcf639d |
|
58 |
+
|
59 |
+
Each row in `data/project_info.csv` looks like the example above.
|
60 |
+
We now get into each field and explain what they are.
|
61 |
+
|
62 |
+
- `id`: an integer from 1 to 120
|
63 |
+
- `project_slug`: (explained in the previous section)
|
64 |
+
- `cve_id`: a common vulnerability identifier `CVE-XXXX-XXXXX`
|
65 |
+
- `cwe_id`: a common weakness enumeration (CWE) identifier. In our dataset, there is only `CWE-022`, `CWE-078`, `CWE-079`, `CWE-094`
|
66 |
+
- `cwe_name`: the name of the CWE
|
67 |
+
- `github_username`: the user/organization that owns the repository on Github
|
68 |
+
- `github_repository_name`: the repository name on Github
|
69 |
+
- `github_tag`: the tag associated with the version where the vulnerability is found; usually a version tag
|
70 |
+
- `github_url`: the URL to the github repository
|
71 |
+
- `advisory_id`: the advisory ID in Github Security Advisory database
|
72 |
+
- `buggy_commit_id`: the commit hash (like `ca4c86b1baa4e0b07975b1da86a34a6e7170b3b7`) where the vulnerability can be reproduced
|
73 |
+
- `fix_commit_ids`: the set of commit hashes (sequentially ordered and separated with semicolon `;`) corresponding to the fix of the vulnerability
|
74 |
+
|
75 |
+
### Fix Info
|
76 |
+
|
77 |
+
The `data/fix_info.csv` file contains the fixed Java methods and classes to each CVE.
|
78 |
+
In general, the fix could span over multiple commits, and a change could be made to arbitrary files in the repository, including resources (like `.txt`, `.html`) and Java source files (including core source code and test cases).
|
79 |
+
In this table, we only include the methods and classes that are considered core.
|
80 |
+
Many of the rows in this table is manually vetted and labeled.
|
81 |
+
Note that there may be fixes on class variables, in which case there will not be method information associated with the fix.
|
82 |
+
A single function may be "fixed" by multiple commits.
|
83 |
+
|
84 |
+
Each row in `data/fix_info.csv` looks like the following.
|
85 |
+
|
86 |
+
| project_slug | cve | github_username | github_repository_name | commit | file | class | class_start | class_end | method | method_start | method_end | signature |
|
87 |
+
|--------------|-----|-----------------|------------------------|--------|------|-------|-------------|-----------|--------|--------------|------------|-----------|
|
88 |
+
| apache__activemq_CVE-2014-3576_5.10.2 | CVE-2014-3576 | apache | activemq | `00921f22ff9a8792d7663ef8fadd4823402a6324` | `activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java` | `TransportConnection` | 104 | 1655 | `processControlCommand` | 1536 | 1541 | `Response processControlCommand(ControlCommand)` |
|
89 |
+
|
90 |
+
- `project_slug`: the unique identifier of each project
|
91 |
+
- `cve_id`: the CVE id
|
92 |
+
- `github_username`: the user/organization that owns the repository on Github
|
93 |
+
- `github_repository_name`: the repository name on Github
|
94 |
+
- `commit`: the commit hash containing this fix
|
95 |
+
- `file`: the `.java` file that is fixed
|
96 |
+
- `class`: the name of the class that is fixed
|
97 |
+
- `class_start`, `class_end`: the start and end line number of the class
|
98 |
+
- `method`: the name of the method that is fixed
|
99 |
+
- `method_start`, `method_end`: the start and end line number of the method
|
100 |
+
- `signature`: the signature of the method. Note that we might have multiple overloaded methods with the same name but with different signatures
|
101 |
+
-
|
102 |
### Dataset Description
|
103 |
|
104 |
<!-- Provide a longer summary of what this dataset is. -->
|