|
Download README.md from ai-sec-lab/PatchBench: direct link, hf CLI and curl.
- Browser
- Download file 3.33 kB
-
https://huggingface.co/datasets/ai-sec-lab/PatchBench/resolve/main/README.md
- Command line
-
hf download hf://datasets/ai-sec-lab/PatchBench/README.md
-
curl -L -o README.md https://huggingface.co/datasets/ai-sec-lab/PatchBench/resolve/main/README.md
3.33 kB
| license: mit | |
| pretty_name: PatchBench | |
| size_categories: | |
| - n<1K | |
| task_categories: | |
| - text-generation | |
| language: | |
| - en | |
| tags: | |
| - code | |
| - security | |
| - vulnerability-repair | |
| - program-repair | |
| - agents | |
| - benchmark | |
| - fuzzing | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: test | |
| path: data/test-*.parquet | |
| # PatchBench | |
| [](https://arxiv.org/abs/2609.04075) | |
| [](https://github.com/ai-sec-lab/PatchBench) | |
| [](https://github.com/ai-sec-lab/PatchBench/blob/main/LICENSE) | |
| PatchBench is a benchmark for evaluating AI agents on realistic vulnerability patching tasks: **213 tasks drawn from 32 popular GitHub C/C++ projects**. It selects vulnerabilities whose ground-truth fixes lie *outside* the crash stack, and uses vulnerability transplant plus code mutation to mitigate surface-level fixes and patch memorization. | |
| This repository holds the **task metadata**, one row per task to identify the project, the exact repository state, the crash, and the reference patch. | |
| ## Dataset Structure | |
| Each example contains: | |
| - **id**: Unique task identifier, also naming the task's image (Same as the one in [ARVO](https://github.com/n132/ARVO-Meta)) | |
| - **image**: Docker Hub image for the task, `b4drequest/vulpatch:{id}-vul` | |
| - **project**: Real-world repository name | |
| - **repo_addr**: Repository URL | |
| - **base_commit**: Historical commit at which the vulnerability is still present, upstream of the developer's fixing commit | |
| - **inverted_commit**: Newer upstream commit the vulnerability was transplanted onto | |
| - **fuzzer**: Fuzzing engine that produced the crash, one of `libfuzzer`, `honggfuzz`, `afl`, `aflpp` | |
| - **sanitizer_type**: The error detection tool type | |
| - **CWE_ID**: The weakness the task's vulnerability manifests, derived from the sanitizer report and confirmed against the ground-truth patch | |
| - **secondary_CWE_ID**: The underlying defect behind it where the evidence pins one down, and `None` where the primary already states the weakness | |
| - **command**: Command that reproduces the crash inside the image, with the PoC at `/tmp/poc` | |
| - **sanitizer_report**: Sanitizer output for the original PoC, including the crash stack | |
| - **patch**: Reference patch against the task repository | |
| `base_commit`, `inverted_commit` and `patch` are **ground truth** and are not visible to the agent during inference. | |
| ## Dataset Usage | |
| ```python | |
| from datasets import load_dataset | |
| dataset = load_dataset("ai-sec-lab/PatchBench", split="test") | |
| ``` | |
| Filtering works the usual way: | |
| ```python | |
| libxml2 = dataset.filter(lambda r: r["project"] == "libxml2") | |
| ubsan = dataset.filter(lambda r: r["sanitizer_type"] == "ubsan") | |
| ``` | |
| ## Evaluation | |
| See our repo for details: [ai-sec-lab/PatchBench](https://github.com/ai-sec-lab/PatchBench). | |
| ## Citation | |
| ```bibtex | |
| @misc{shen2026PatchBench, | |
| title = {{{PatchBench}}: Evaluating {{AI}} Agents for Vulnerability Patching}, | |
| author = {Shen, Chihao and Li, Jiacheng and Mahajan, Aastha and Tian, Jeffery Siyuan and Kwon, Yonghwi and Chen, Yizheng}, | |
| year = 2026, | |
| number = {arXiv:2609.04075}, | |
| eprint = {2609.04075} | |
| } | |
| ``` | |