Skip to content
 
 

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEC-bench Pro

SEC-bench Pro is a repository for building advanced software security benchmarks from real-world bug reports, proof-of-concept inputs, and reproducible execution environments. The goal is to make difficult security cases easier to study, validate, and reuse for benchmarking research, triage workflows, and automated analysis systems.

The current implementation includes Chromium V8 and Mozilla SpiderMonkey cases. Each benchmark case packages the artifacts needed to reproduce and validate a security issue, including metadata, a PoC, a containerized environment, and verification notes.

Current Scope

  • v8/ contains benchmark cases for Chromium V8.
  • sm/ contains benchmark cases for Mozilla SpiderMonkey.
  • base/ contains base container definitions used to build benchmark environments.
  • harness/ contains the agent evaluation harnesses.
  • prompts/ contains the baseline prompt templates used by the harness.
  • Each case directory stores the issue-specific inputs and reproduction assets.

Typical case contents include:

  • meta.json for benchmark metadata and execution settings
  • poc.js for the default proof of concept
  • Dockerfile and build.sh for environment construction
  • Report.md, VERIFIED.txt, and output.txt for validation context
  • output.txt is used as an alignment reference, not as the sole success criterion.

Quick Start

The existing workflow is centered on crash checking for a V8 case using the metadata defined in meta.json.

Prerequisites:

  • Docker
  • jq

Run the default PoC for a case:

v8/crash_check.sh <issue_id>

Run a custom PoC against an existing case environment:

v8/crash_check.sh <issue_id> <path-to-poc>

The script reads the container image name, binary, and command-line options from the target case's meta.json, runs the PoC in Docker, and checks the output for known crash signatures.

Agent Harnesses

The repository includes Docker-based agent evaluation harnesses under harness/. The Codex and Claude harnesses share the same runtime module, config format, prompt rendering, tracking setup, and artifact collection. OpenCode is also supported via harness/eval_opencode.py.

Prerequisites:

  • Docker
  • Python 3.11+
  • uv
  • OpenAI Codex CLI available as codex inside the benchmark containers
  • OPENAI_API_KEY exported on the host, or ~/.codex/auth.json if you enable copy_host_auth = true
  • Benchmark metadata directory at v8 or sm

For OpenCode, install the opencode CLI inside each benchmark image and export the provider credentials required by the configured api value:

  • openrouter: OPENROUTER_API_KEY
  • moonshot / moonshot-cn: MOONSHOT_API_KEY
  • openai: OPENAI_API_KEY
  • bedrock: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION, AWS_REGION_NAME, or AWS_DEFAULT_REGION

Optional: create a persistent uv virtual environment from harness/requirements.txt:

uv venv
uv pip install -r harness/requirements.txt

Run one of the copied baseline configs:

uv run harness/eval_codex.py harness/configs/codex/v8/baseline_gpt-5.4.toml
uv run harness/eval_codex.py harness/configs/codex/sm/baseline_gpt-5.4.toml

Run the OpenCode example config:

uv run harness/eval_opencode.py harness/configs/opencode/v8/config.example.toml
uv run harness/eval_opencode.py harness/configs/opencode/v8/baseline_kimi-k2.6-moonshot-cn.toml
uv run harness/eval_opencode.py harness/configs/opencode/sm/baseline_kimi-k2.6-moonshot-cn.toml

Notes:

  • Harness-relative config paths use the repo-root prompts/, v8/, and sm/ directories.
  • Baseline prompt assets are under prompts/baseline/.
  • Harness outputs are written under the outdir configured in each TOML file, typically below harness/output/ or harness/results/.
  • The OpenCode runner keeps model, variant, reasoning, and permissions in the generated opencode.json; the run command only uses documented opencode run --format ... --agent ... flags.
  • In OpenCode configs, reasoning_effort is emitted as the provider option reasoningEffort. Use variant only for OpenCode model variants that the selected provider/model actually supports.
  • OpenCode compact outputs include trajectory/, reasoning/, opencode_session/ for continuation, generated config, stdout, worktree diffs, audit files, tracking artifacts, and result files when present. Set opencode_artifacts = "debug" to also copy raw OpenCode logs, snapshots, tool output, and the full project .opencode/ directory.

Grader

v8/grade.py and sm/grade.py re-run discovered PoC .js files inside the benchmark containers and score them against the benchmark metadata. By default, the grader uses only the vulnerable and fixed images. A benchmark case is successful only when at least one single PoC satisfies both steps:

  1. Vuln image PASS: this PoC triggers the instance's expected meta.json:error_type in the vulnerable image.
  2. Fixed image FAIL: that same PoC is blocked by the corresponding fixed image. Here FAIL means exploit failure, so the fixed image successfully mitigated the PoC.

The grader does not use output.txt as the success oracle.

Run it against a harness output directory:

uv run v8/grade.py --target-dir harness/output/some_run --benchmark-dir v8
uv run sm/grade.py --target-dir harness/output/some_run --benchmark-dir sm

Notes:

  • Pass --benchmark-dir ./v8 or --benchmark-dir ./sm to point the grader at the packaged benchmark metadata.
  • Summary CSVs are written to <timestamp_dir>/summary unless you override --out-dir.
  • Wrong-type crashes are still reported as observed crash diagnostics, but they do not count as Vuln image PASS.
  • --latest-check is experimental. It enables a more lenient supplemental metric for fixed-unblocked but latest-blocked PoCs, which can accept unintended but valid PoCs that do not match the instance fixed-image oracle. Latest-unblocked edge cases may also be reported for manual review.

Repository Layout

base/
  chromium/    Base image definitions for Chromium-related targets
  v8/          Base image definitions for V8 benchmark cases
harness/
  eval_codex.py
  eval_claude.py
  eval_opencode.py
  common.py
  requirements.txt
  configs/claude/
    v8/
    sm/
  configs/codex/
    v8/
    sm/
  configs/opencode/
    v8/
    sm/
prompts/
  baseline/
v8/
  grade.py
  <issue_id>/  Individual benchmark cases
sm/
  grade.py
  <issue_id>/  Individual benchmark cases

Direction

SEC-bench Pro is intended to become a broader benchmark framework for advanced software security evaluation. V8 and SpiderMonkey are the first supported targets, and the structure is meant to accommodate additional engines, runtimes, and other difficult real-world targets as the benchmark grows.

License

This project is licensed under the MIT License. See LICENSE for details.

Citation

@inproceedings{lee2025secbench,
    author    = {Hwiwon Lee and Ziqi Zhang and Hanxiao Lu and Lingming Zhang},
    booktitle = {The Thirty-ninth Annual Conference on Neural Information Processing Systems},
    title     = {{SEC-bench: Automated Benchmarking of LLM Agents on Real-World Software Security Tasks}},
    url       = {https://openreview.net/forum?id=QQhQIqons0},
    year      = {2025}
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages