The dataset viewer is not available for this split.
Error code: TooBigContentError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
VulSpot
VulSpot is a statement-level dataset for vulnerability detection, CWE classification, and localization.
It follows the SecVulEval collection pipeline (NVD CVEs with a Patch tag, GitHub fixing commits, function extraction, filtering) through 2026, and adds AST-level statement diffs, sink-candidate anchors for additive fixes, label-confidence tiers, untouched negatives, and deterministic local context. It does not include the LLM-generated §3.4 context of SecVulEval.
from datasets import load_dataset
cpp = load_dataset("DynaOuchebara/VulSpot", "cpp", split="full")
multi = load_dataset("DynaOuchebara/VulSpot", "multi", split="full")
Configs
| config | contents |
|---|---|
cpp |
C/C++ only (.c/.cc/.cpp/.h/.hpp/...) |
multi |
every supported language, with a language column |
Each config has two splits:
full— every row that survived structural filtersbalanced—fullwith a per-year cap on post-2024 kernel.org-CNA Linux CVEs (seeis_kernel_cna)
Chronological and project-holdout index files live next to the parquet (splits/chrono.json, splits/project_holdout.json). They refer to the idx column.
Collection
- NVD (API 2.0): all non-rejected CVEs, windowed by publication date, incremental via
lastModified. - Patch commits: references tagged
Patchwhose URL is a GitHub commit (plusgit.kernel.orgremapped totorvalds/linux). Other hosts are counted in the pipeline report and not fetched. Forks are kept only if the SHA exists on the parent, and are attributed to the parent. - Commit artifacts: GitHub REST +
raw.githubusercontent.com(message, unified diff, before/after file contents). Merge commits are dropped. - Functions: tree-sitter extraction; before/after pairing by name + signature + order; statement-unit AST diff.
- Filters: extension filter; multi-commit CVEs dropped; files with no in-function edits dropped; tangled-change heuristic becomes a confidence tier rather than a hard drop (unmentioned functions in multi-function files are still dropped).
Label semantics
Two localization layers:
changed_lines/changed_statements(fix_*): SecVulEval semantics. On a vulnerable row these are the deleted/updated statements; on a fixed row, the added/updated ones. Serialized as JSON strings[[line, text], ...]with file-absolute line numbers so existing SecVulEval loaders work.sink_candidates(vulnerable rows only): deleted + updated statements, plus insertion anchors in the vulnerable version (the next statement, or, for a guardif (...) return/goto/break/continue, the first later use of a guard identifier). Each entry has abs/rel line, byte range, text, andkind.
is_vulnerable is the function-level flag. cwe_list / cwe_1003_list are the type labels (raw NVD CWEs and the CWE-1003 simplified-mapping view).
Confidence tiers (label_confidence)
high— the commit changes exactly one function (test files excluded), or the function is named in a linked CVE descriptionmedium— the only changed function in its file, but the commit touches several fileslow— several functions changed in the file; this one is named in the commit message
Negatives (neg_type)
fixed— patched version of a vulnerable functionuntouched— unchanged function from a file that also contains a changed functionpatched_later_vulnerable— afixedrow whose function is modified again by a later CVE commit in this dataset (later_fixed_by)
clean is true when label_confidence ∈ {high, medium} (or the row is an untouched negative), label_conflict is false, and neg_type is not patched_later_vulnerable.
is_kernel_cna flags CVEs assigned by the kernel.org CNA with published_date ≥ 2024-02-01.
Splits
splits/chrono.json— 80/10/10 by CVEpublished_date, then clone-group aware (clone_group_id): a row whose near-duplicate group already appears in an earlier split (train < val < test) is excluded, so train never contains rows newer than test.splits/project_holdout.json— a random ~10% of rows, taken as whole projects, as test (Linux always stays in train/val); the rest split chronologically into train/val. Same clone-group exclusion.
Both files also contain evaluation subsets of test:
test_high—cleantest rows, without vulnerable rows whoselabel_confidenceis nothigh(all negatives kept)test_paired_high— high-confidence vulnerable rows whose fixed version is also in test, plus those fixed versions (PrimeVul-style paired evaluation)test_no_linux— test withouttorvalds/linuxrows
In balanced, the post-2024 kernel CVEs kept each year are a seeded sample spread over the year, so chronological val/test still contain some Linux.
Exact duplicates use hash (md5 of per-line-stripped body). norm_hash drops comments/whitespace. clone_group_id is MinHash-LSH (5-shingles, Jaccard ≥ 0.8).
Licensing
Function bodies are reproduced verbatim from the original open-source repositories for research. Each row points back to its source via project_url and commit_id. The code remains under the license of its original project. This dataset does not grant or claim a single license covering the code.
- Downloads last month
- -