← Lab /Software

LLM vulnerability detectors often fail to distinguish vulnerable from fixed code

LLM-based vulnerability detectors do not reliably understand or locate vulnerabilities in code

Software arXiv 21 Nov 2026 Measurement Prototype evidence

Published as “Right Verdict, Right Reason? An Execution-Grounded Study of Whether LLM Vulnerability Detectors Understand Vulnerabilities”

Why it matters

LLM vulnerability detectors cannot yet reliably replace human review for patch validation because they often mislabel fixed code and lose predictive power on unseen vulnerabilities.

Summary

Commercial LLM detectors can locate the fault line of a vulnerable C/C++ function better than simple keyword rules, and they can predict the outcome of a concrete run given the input, but they still often label fixed versions as vulnerable and struggle to distinguish vulnerable from fixed code. This advantage in fault localization persists after the models' training cutoffs, while the ability to predict run outcomes disappears on newer vulnerabilities. The evidence comes from 515 functions with execution-grounded references and a follow-up set of 195 post-cutoff CVEs, compared against multiple non-understanding baselines.

What they found 5

  1. Open-weight models do not separate vulnerable from fixed functions better than chance.

    “The open-weight models separate no more pairs than chance”

  2. Commercial models still label many screened fixed versions as vulnerable.

    “the commercial models still label many screened fixed versions vulnerable”

  3. Commercial models cite the trigger line far more often than a keyword rule.

    “The commercial models cite the trigger line far more often than a keyword rule”

  4. With driver and input, commercial models predict run faults better than a guard rule.

    “With the driver and the input in view, all four commercial models predict whether a run faults better than a rule that knows the vulnerable version and accepts every added check”

  5. On newer vulnerabilities the advantage in outcome prediction disappears and the lead of the strongest model narrows.

    “On the newer vulnerabilities this advantage disappears and the lead of the strongest model narrows”

Caveats 5

  • The advantage in predicting run outcomes (L5) vanishes on the post-cutoff CVEs, reducing the commercial models to the level of a simple guard rule.
  • The lead of Claude Opus 5.5 in discriminating vulnerable from fixed functions (L1) narrows on newer vulnerabilities, with only a marginal above-chance performance.
  • The functions are C and C++ functions with a reproducible proof of concept and a complete dynamic slice, which favors memory-safety faults and short call chains.
  • The proofs of concept are built with one confirmation method, VulValidate with Claude Opus 5.0, so the set of functions also reflects which faults its dynamic tools can trigger and attribute to the labeled function.
  • The study covers thirteen LLMs and no fine-tuned detector such as LineVul [19] or DeepDFA [43].

What’s new here 4

  • Provides an execution-grounded reference (trigger line and dynamic slice) for each vulnerability instead of static or human rationales.
  • Introduces a five-level test ladder with paired shortcuts and controls to isolate understanding, localization, evidence reliance, counterfactual edits, and execution prediction.
  • Creates a counterfactual benchmark of 315 edited variants whose labels are confirmed by re-executing the proof of concept.
  • Evaluates both open-weight and commercial LLMs on pre- and post-training-cutoff vulnerabilities to assess memorization effects.