← Lab /AI/ML

LLMs select secure code only 48-89% of the time on a CVE-based benchmark

LLMs achieve security scores between 0.48 and 0.89 on the TOSSS benchmark

AI/ML arXiv 11 Mar 2026 Benchmark Prototype evidence

Published as “TOSSS: a CVE-based Software Security Benchmark for Large Language Models”

Why it matters

TOSSS gives practitioners a concrete, extensible security score they can report alongside traditional LLM benchmarks, and shows that prompting for security can noticeably improve model behavior.

Summary

The TOSSS benchmark shows that LLMs vary widely in their ability to pick secure code, with scores from 0.48 to 0.89 across 14 models. Providing an explicit security hint improves most models by up to +0.10, though one model (Codestral 2508) gets worse. Coding-specialized models rank near the bottom, indicating that code-generation training does not guarantee security awareness. The benchmark is built from CVE-derived code pairs, making it extensible beyond static-analyzer-based tests.

What they found 4

  1. Model scores span from near-random to high security awareness

    “On C/C++, scores range from 0.480 (Mistral Large 2512) to 0.878 (GLM-5).”

  2. Explicit security hints can raise scores by up to ten percentage points

    “explicitly mentioning security in the prompt improved scores by up to +0.10.”

  3. One model performs worse when given the security hint

    “Codestral 2508 is the only model whose performance decreases when given the security hint.”

  4. Coding-specialized models rank among the bottom performers

    “both rank among the bottom four models in the hintless setting for both languages.”

Caveats 6

  • Mistral Large 2512 achieves a score of 0.48, essentially random guessing in the hintless C/C++ setting
  • Codestral 2508’s performance drops when a security hint is added, showing that prompts can hurt rather than help
  • Coding-focused models (Qwen3 Coder Next, Codestral 2508) are among the lowest-scoring models despite being optimized for code tasks
  • our evaluation is limited to these programming languages.
  • this effort lies outside our scope
  • Although code selection is not the most common usage scenario, it remains meaningful for assessing software security capabilities.

What’s new here 4

  • Uses CVE-mined vulnerable and fixed code pairs instead of generated code evaluated by static analyzers
  • Provides a simple, interpretable security score (proportion of secure selections)
  • Supports extensibility by automatically incorporating new CVE disclosures via the MegaVul pipeline
  • Evaluates the effect of explicit security hints on model behavior