This directory contains the ground truth for naptrace's benchmark suite.
# Run the built-in benchmark corpus
naptrace bench
# Run with a custom corpus file
naptrace bench --corpus my_cves.yamlCreate a YAML file following this schema:
- cve: CVE-YYYY-NNNNN
description: "Short description of the vulnerability"
bug_class: INTEGER_OVERFLOW # See bug classes below
source_repo: https://github.com/org/repo
patch_commit: abc123def456 # The commit SHA that fixed it
language: c # c, cpp, java, python, go, rust, javascript, typescript
family: my_family # Group related CVEs
variants:
- file: path/to/file.c
function: vulnerable_function
is_feasible: true # true = confirmed variant, false = patched/unreachable
notes: "Why this is or isn't a variant"
- file: path/to/other.c
function: safe_function
is_feasible: false
notes: "Has overflow check at line 42"Use one of these values for bug_class:
INTEGER_OVERFLOW/INTEGER_UNDERFLOWOOB_READ/OOB_WRITEUSE_AFTER_FREE/DOUBLE_FREENULL_DEREFTYPE_CONFUSIONINJECTION(SQL, command, format string)DESERIALIZATIONAUTHZ_BYPASSPATH_TRAVERSALRACE_CONDITIONOTHER
- Use CVEs from 2024 or later to avoid LLM training data leakage
- Always include the
patch_commitSHA so the patch can be fetched - Include both feasible (true positive) and infeasible (true negative) variants
- Document why each variant is feasible or not in the
notesfield - Prefer CVEs where the variant relationship is documented (blog posts, advisories)
To contribute a CVE to the benchmark:
- Fork the repo
- Add your entry to
ground_truth.yaml(or create a new file) - If possible, add the patch file to
corpus/<cve_id>/patch.diff - Open a PR with a description of the variant relationship
We accept CVEs in any of the 8 supported languages.
See ground_truth.yaml for the full list of 15 CVEs across 8 families.