页面简介
CWE-bench v2: a public benchmark to test frontier cyber capabilities. 100 open audit-and-patch tasks across 91 CWEs, a 150-task held-out set, 185 CWEs in all. The top model scores 75.0% pass@1 across both sets.
正文摘录
CWE-bench Broader coverage. Fairer grading. Open to all. A public benchmark to test frontier cyber capabilities: 100 audit-and-patch tasks across 91 distinct CWEs, open to everyone and graded by deterministic verifiers. A held-out set of 150 more tracks progress on tasks no model has seen. The public set, grader and harness are open. The held-out set remains closed. Get the public set Read the paper → Top model performance 75.0% Unsolved by every model 13 of 250 Weakness types 185 Pareto frontier Claude Fable 5.2Gemini 4 NeonGemini 4 HydrogenClaude Opus 5.5GPT-6.2 SolClaude Sonnet 5.5GPT-6.1 TerraDeepSeek-V4.1-Flash (1017) CWE-bench leaderboard Combined (250) Public (100) Held-out (150) Results as of December 3, 2026, on all 250 tasks, public and held-out. RankModelHarnessPass@1Pass@4Avg cost / rollout 1 Claude Fable 5.2 Claude Code 75.0% 82.8% $7.85 2 Gemini 4 Neon Antigravity 70.7% 76.4% $6.52 3 Gemini 4 Hydrogen Antigravity 68.1% 78.0% $2.63 4 Gemini 4 Carbon Antigravity 67.3% 76.4% $4.27 5 Claude Opus 5.5 Claude Code 67.1% 79.2% $1.85 6 GPT-6.2 Astra Codex 66.8% 72.0% $4.32 7 Muse Wonder opencode 66.1% 78.8% $2.73 8 GPT-6.2 Sol Codex 66.0% 74.0% $0.81 9 Gemini 4 Argon Antigravity 65.0% 77.2% $3.70 10 GPT-6 Astra Codex 64.2% 72.8% $3.87 11 Hy4 Claude Code 64.1% 78.4% $1.35 12 Claude Sonnet 5.5 Claude Code 61.4% 74.8% $0.58 13 GPT-6.1 Terra Codex 60.0% 69.2% $0.44 14 DeepSeek-V4.1-Flash (1017) opencode 57.6% 73.6% $0.04 15 Amazon Ergo 1.0 opencode 55.9% 74.8% $1.61 16 Grok 4.7 opencode 54.7% 71.2% $2.97 17 GPT-5.6 Cyber Codex 50.5% 69.6% — 18 MiniMax-M3.1-Flash (max) Claude Code 49.4% 69.2% $0.41 19 Hy4 Preview opencode 47.3% 64.4% $0.43 20 Mistral Large 4 opencode 45.6% 60.4% $0.37 21 Qwen3.8-Max (0902) opencode 45.4% 64.8% $2.06 22 Kimi K3.1 Pro opencode 45.3% 64.0% $0.96 23 GLM-5.3 opencode 42.0% 63.6% $0.58 How the scores are computed. Each model gets four rollouts on each of the 250 tasks, at high reasoning. Each rollout has a one-hour limit; a rollout that reaches it is graded on the code as it stands at that point. A rollout lost to infrastructure (a provider error, a rate limit) is rerun rather than counted, so every score rests on four valid attempts per task. Output caps. Amazon Ergo 1.0 ran with opencode’s output cap raised to the provider maximum (131,072 tokens). At opencode’s default 32k cap, 9 of its first 28 rollouts were cut off mid-reasoning. GLM-5.3 ran with opencode’s default 32k output cap; 65 of 1,000 rollouts hit it. On the Pareto frontier, 196× the cost buys 1.30× the pass rate Pass@1 and average cost per rollout over all 250 tasks, public and held-out. What’s new in v2: coverage, quality, transparency CWE-bench is designed to test the limits of frontier cyber capabilities. v2 is built around three changes: far more weakness types, a stricter review of every task, and a public set that anyone can run and check. Coverage A defender has to get it right every time. 185 distinct CWEs, up from 73 in v1, so recognising a familiar pattern is not enough. Quality Every task passed seven checks and a review by hand. Verifiers were shaped toward hardness and fairness with LLM judge panels. Transparency The public set, grader and harness are open. Scoring is programmatic, so anyone can reproduce a result at no extra cost. A held-out set 150 further tasks are held back, so we can keep tracking progress on tasks no model has seen. Seven checks on every task CheckWhat it rules out Realistic instructionInstructions that read like an evaluation setting rather than a real request. Inferable requirementsGraded behaviour that cannot be inferred from the instruction. Behaviour, not structureVerifiers overfit to the structure of one fix instead of checking for correct behaviour. Reference and baselineA reference fix that fails, or an untouched repository that passes. Fix without breakingFixes that block the exploit but break legitimate functionality and still pass. No memorized fixesTasks that can be solved by copying the known upstream patch. Reliable environmentEnvironments that fail to build or run, so a failed rollout reflects the infrastructure rather than the model. Open-sourcing the public set is part of the same effort. We welcome feedback on any task, and contributions to the public set. From v1 to v2 v1v2 Tasks120, held out100 public + 150 held-out Distinct CWEs73185 (91 public) GroupingOWASP Top 10 (2025)Ten CWE-bench weakness classes GradingDeterministic gate, plus a three-judge panel reported beside itDeterministic verifiers, curated with judge panels Who can run itCollinear and Artificial AnalysisAnyone, on the public set How CWE-bench works CWE-bench mirrors a real security audit. Teams rarely receive a ticket naming the flaw; they receive a codebase and a reason to investigate. Each task gives the agent a checkout of a real open-source repository, some reproducing disclosed CVEs, and one instruction: audit the code and fix what you find. Audit and fix The task reveals neither the vulnerabilities nor how many there are, so each audit starts from a blank slate. Focused on cyber defense Tasks test an agent’s ability to defend real codebases; agents are never asked to create exploits. Fix without breaking Strict graders verify that the exploit is blocked and existing functionality still works. No memorized fixes Agents must reason from the code. We exclude tasks that can be solved from memorized fixes alone. Coverage across languages, CWEs and ten weakness classes 250 tasks by language C/C++58 JS/TS54 Go50 Java40 Python35 Rust13 Weakness types 185 distinct CWEs CWE-117 Log injection CWE-444 Request smuggling CWE-1427 LLM prompt injection CWE-843 Type confusion CWE-757 Algorithm downgrade 91 in the public set; +180 more, mapped below ↓ Ten weakness classes, 17 to 40 tasks each K01 Injection (27) K02 Input validation & parsing (25) K03 Memory & resource safety (40) K04 Access control (29) K05 Authentication & sessions (23) K06 Cryptography & secrets (28) K07 Trust boundaries & request handling (18) K08 Supply chain & data integrity (18) K09 Information exposure & logging (25) K10 Error handling & logic flaws (17) Weakness classes. OWASP’s Top 10 has room for the 73 CWEs of v1, not the 185 of v2: many of the new ones (request smuggling, prompt injection, type confusion, certificate revocation) sit at its edges or outside it. v2 groups every CWE into ten classes of our own, in the spirit of OWASP but not an official taxonomy. Each CWE’s class is shown in the map below. Distribution of CWEs across weakness classes One bubble per CWE, sized by how many tasks carry it and clustered into its weakness class. Area = tasks carrying that CWE, across the public and held-out sets. The set is built for breadth, so most CWEs carry one task; per-model results are reported by weakness class in the heatmap below, where each figure rests on 17 to 40 tasks. Grading: deterministic verifiers, curated with judge panels Every task ships a reference patch that its verifier passes, and an untouched repository that it fails. StageWhat happens Deterministic verifierA programmatic exploit check confirms the exploit no longer works, and legitimate cases confirm existing behaviour still holds. No partial credit. This is the score on the leaderboard and in every figure, and anyone can rerun it. Judge-panel curationWhile the set was built, panels of LLM judges from different model families reviewed each verifier against real patches. Wherever a panel disagreed with a verifier, the verifier was reviewed by hand and corrected toward hardness and fairness: a correct fix must pass, and a fix that breaks legitimate behaviour or games the check must fail. Failure mode analysis By weakness class: trust boundaries, authentication and error handling are the shared weak spots Model × weakness class at a glance Pass@1 over all 250 tasks, public and held-out, so each cell rests on 17 to 40 tasks rather than the handful a single set would give. By language: Rust and C/C++ lead, Python trails Deterministic pass@1 by language Pass@1 over all 250 tasks. Rust rests on thirteen tasks; every other language on 35 or more. In practice: where agents fail A run can fail before a patch is written, or after a convincing patch appears complete. Diagnosis failures 01 Locate Localization failure The agent never reaches the vulnerable code. 02 Recognize Missed detection The agent inspects the vulnerable code but judges it benign. Remediation failures 03 Repair Wrong invariant The agent patches the right code without restoring the security property. 04 Complete Incomplete remediation The agent fixes some vulnerabilities but leaves others open. Sample task: hardening a real image decoder BlurHash turns a short string into the blurred preview shown while a photo loads. The open source blurhash-rs library decodes that string into pixels. Those strings can arrive through feeds and APIs, so the decoder has to treat them as untrusted input. In the vulnerable version, some malformed strings make the Rust decoder panic instead of returning an error. The task is to make those inputs fail safely while preserving the output of valid BlurHashes. Training example Rust Real vulnerability CVE-2023-42447 01 The task Harden the decoder without breaking valid output The public decode function must satisfy one invariant: every call returns either decoded pixels or a typed error that the caller can handle. No input may trigger a panic. Required outcome for each kind of input to the decode function. ConstraintRequired outcome Valid BlurHashSame pixel output Malformed BlurHashTyped error, no panic Existing callersPublic interface still compiles The instruction points to string handling and the arithmetic that follows parsing. It does not reveal the failing inputs, affected lines, or required patch. View full task Review the decoding surface of this library and make it resilient to malformed and adversarial input. The guarantee we need is simple to state and easy to get wrong: F