openSUSE/cve-backport-codegen-dataset
CVE Backport Code Generation Dataset Per-hunk code generation dataset for CVE security patch backporting, derived from openSUSE Build Service maintenance patches. Task Given a region of vulnerable source code and a description of the upstream CVE fix, the model outputs the fixed version of the code. A programmatic diff then produces the final patch. This plays to LLM strengths in code completion and avoids format-sensitivity issues with direct diff generation.… See the full description on the dataset page: https://huggingface.co/datasets/openSUSE/cve-backport-codegen-dataset.
CVE Backport Code Generation Dataset
Per-hunk code generation dataset for CVE security patch backporting, derived from openSUSE Build Service maintenance patches.
Task
Given a region of vulnerable source code and a description of the upstream CVE fix, the model outputs the fixed version of the code. A programmatic diff then produces the final patch. This plays to LLM strengths in code completion and avoids format-sensitivity issues with direct diff generation.
Files
Version History
Format
All v5 examples use 3-turn ChatML format (system / user / assistant):
{
"messages": [
{"role": "system", "content": "You are a security patch backporting assistant..."},
{"role": "user", "content": "## File: lib/url.c\n## Lines: 100-130\n\n```c\n{vulnerable code}\n```\n\n## Fix\nCVE-2024-1234: description"},
{"role": "assistant", "content": "{fixed code}"}
],
"metadata": {
"cve_id": "CVE-2024-1234",
"package": "curl",
"language": "c",
"tier": "identical",
"suse_license": "MIT"
}
}Coverage
- 2,300+ CVEs across 145 packages
- Languages: C (80%), Python (7%), C++ (3%), Shell, Perl, JavaScript, Java, Go, PHP, Ruby
- Tiers: identical (patch applies directly), adapted (context differs), synthetic-adapted (cross-version augmentation)
- 99.8% per-example SPDX license metadata
Licenses
All training examples are derived from publicly available openSUSE Build Service maintenance patches. Per-example license metadata is in metadata.suse_license. The most common licenses are:
LGPL-2.1-or-later, OpenSSL, GPL-2.0-only, MIT, PHP-3.01, Apache-2.0, GPL-2.0-or-later, BSD-3-Clause, GPL-3.0-or-later, BSD-2-Clause, Python-2.0, MPL-2.0, ImageMagick
Model
Trained models are at openSUSE/CVE-Backport-Qwen2.5-Coder-32B.
The CLI tool for using the model is at github.com/openSUSE/cve-backport-tool.
