--- 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. ### 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. ## 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. ## 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.