Evaluation framework for AI-driven parser security. An AI agent is given a vulnerable parser and a crash report, and must produce a patch that eliminates the vulnerability. Benchmarked against 209 real-world vulnerabilities from ARVO across 4 parser libraries, with ground-truth reference patches for scoring.
- Python 3.14+ and uv
- Docker (for building and fuzzing parser targets)
- ~200 MB disk for the ARVO-Meta database download (cached)
All commands run from the scaffold/ directory.
cd scaffold
uv syncIngest vulnerability metadata from ARVO and/or oss-fuzz, filter to Category 1 targets, deduplicate, and export benchmark/metadata.json:
uv run parser-security-eval curate arvoThis populates benchmark/ with per-vulnerability directories containing crash reports and empty reference patch stubs.
Download the ARVO-Meta SQLite database, look up fix commits, and generate reference_patch.diff for each vulnerability from upstream git history:
uv run parser-security-eval fetch-artifactsThis fills in the reference_patch.diff files that step 1 left empty. Patches are generated via git diff fix_commit~1..fix_commit from shallow upstream clones. Expects ~87% coverage of ARVO records.
Replace stub crash reports with full ASAN output from the ARVO-Meta database, map crash types to CWE IDs, and optionally extract crash inputs from ARVO Docker images:
# Fast: enrich crash reports + CWE mapping + vulnerable sources (seconds)
uv run parser-security-eval enrich-dataset --no-crash-inputs
# Full: also extract crash inputs from Docker images (slow, pulls ~127 images)
uv run parser-security-eval enrich-dataset --crash-inputsBuild the Category 1 parser targets in Docker (oss-fuzz base-builder images with AddressSanitizer):
uv run parser-security-eval build-target libpng
uv run parser-security-eval build-target libjpeg-turbo
uv run parser-security-eval build-target libxml2
uv run parser-security-eval build-target zlibRun an Inspect-AI evaluation task against a model:
uv run parser-security-eval evaluate patching --model anthropic/claude-sonnet-4-6
uv run parser-security-eval evaluate triage
uv run parser-security-eval evaluate harness --target libpngRun multi-model, multi-target evaluation sweeps from a TOML config:
# Preview what will run (no execution)
uv run parser-security-eval experiment run experiments/patching-model-sweep.toml --dry-run
# Execute the sweep (restartable — safe to Ctrl-C and resume)
uv run parser-security-eval experiment run experiments/patching-model-sweep.toml
# Check progress
uv run parser-security-eval experiment status results/patching-model-sweep
# Analyze results (rich tables + optional JSON export)
uv run parser-security-eval experiment analyze results/patching-model-sweep --json results.jsonExample TOML configs in scaffold/experiments/: patching-model-sweep.toml, triage-sweep.toml, fuzzing-baseline.toml.
Test a specific patch against a vulnerability:
uv run parser-security-eval verify libpng ARVO-42498959 path/to/patch.diffparser-security-eval/
benchmark/ Curated vulnerability dataset
metadata.json 209 records with IDs, targets, severities, paths
arvo/ARVO-{id}/ Per-vulnerability artifacts (gitignored — run steps 1–3 below)
crash_report.txt Full ASAN/MSAN crash output
crash_input Triggering input bytes (from ARVO Docker images)
reference_patch.diff Ground-truth fix (from upstream git)
vulnerable_src/ Pre-fix source files (from upstream git)
scaffold/ Python package (uv project)
src/parser_security_eval/
cli.py Typer CLI entry point
dataset/
arvo.py ARVO metadata ingestion
artifacts.py Reference patch fetching from ARVO-Meta
enrich.py Crash report, CWE, and crash input enrichment
curator.py Deduplication, validation, export
ossfuzz.py oss-fuzz bug ingestion
models/
vulnerability.py VulnerabilityRecord pydantic model
sandbox/
docker.py Docker sandbox for builds and fuzzing
scorers/
patch.py Patch correctness scorer
coverage.py Code coverage scorer
tasks/
patching.py Vulnerability patching eval task
triage.py Crash triage eval task
harness.py Fuzz harness generation eval task
fuzzing.py Live fuzzing eval task
experiments/
models.py Pydantic models for experiment configs and state
runner.py Grid expansion, task building, run loop
state.py Manifest persistence (atomic save/load/resume)
analysis.py Results aggregation and breakdowns
cli.py Typer sub-app (run/status/analyze commands)
experiments/ Example TOML experiment configs
targets/ Parser target definitions (oss-fuzz compatible)
libpng/ Dockerfile, build.sh, metadata.yaml, corpus/
libjpeg-turbo/
libxml2/
zlib/
_template/ Skeleton for adding new targets
All commands: uv run parser-security-eval <command> --help
| Command | Description |
|---|---|
curate <source> |
Ingest from arvo, ossfuzz, or all. Writes benchmark/metadata.json. |
fetch-artifacts |
Download ARVO-Meta DB, generate reference patches from upstream repos. |
enrich-dataset |
Enrich crash reports with ASAN output, map CWE, extract crash inputs/sources. |
build-target <target> |
Build a parser target in Docker with sanitizer + fuzz engine. |
evaluate <task> |
Run an Inspect-AI eval: patching, triage, or harness. |
fuzzing |
Run a single-agent live fuzzing campaign. |
experiment run <config.toml> |
Run or resume a TOML-driven experiment sweep. |
experiment status <output_dir> |
Show run statuses for an experiment. |
experiment analyze <output_dir> |
Leaderboard + breakdowns from completed runs. |
verify <target> <id> <patch> |
Test a patch against a specific vulnerability. |
cd scaffold
uv run ruff check --fix # lint
uv run ruff format # format
uv run pytest # test (333 tests)