SteelYourHeart: Catching LLMs Taking Shortcuts in Vulnerability Detection

Run Hao, Zhuoran TanarXiv 2026

TL;DR

When an LLM reviews code for security bugs, it often takes a shortcut: if it spots a security check (a "guard"), it assumes the code is safe without actually testing whether an attacker can bypass it. SteelYourHeart is a new benchmark of 195 real-world "incomplete fixes" that exposes this habit—showing that even when LLMs flag vulnerable code, their reasoning is frequently wrong, and showing them the patch can actually trick them into approving a bug they previously caught.

What Problem Does This Paper Address?

LLMs are increasingly used to hunt for software vulnerabilities and review security patches. Most existing benchmarks score these models on a simple binary verdict: is this code vulnerable or not?

That creates a blind spot. A model can get the right answer ("exploitable!") for a completely wrong reason, or it can miss a bug because it sees a security check—like a URL decoder or a path sanitizer—and assumes the check works. In reality, incomplete fixes are a major source of real-world exploits (Google Project Zero found that at least half of the 18 zero-days exploited in the wild in early 2022 were variants of previously patched bugs). The authors ask: how reliably do LLMs verify that a security guard is actually complete, and how does their reasoning break down when they fail?

Methods

To isolate the final step of vulnerability detection—deciding whether a specific piece of code is exploitable—the authors built an explanation-aware evaluation pipeline around vulnerabilities that were fixed twice.

Overview of SteelYourHeart benchmark construction and evaluation

In each case, an initial patch ($\Delta_1$) adds a guard to vulnerable code ($V_0$), producing $V_1$, which still has a documented bypass that a second patch ($\Delta_2$) later closes. Models are given a manually validated code slice of $V_1$ (up to 8 files and 1,600 lines) and the vulnerability class, and evaluated in two settings:

  1. Detection: The model sees only the code of $V_1$ and must decide if it is exploitable and explain why.
  2. Patch review: The model sees the exact same code, plus the $\Delta_1$ diff presented as a proposed fix.

Instead of just scoring the binary verdict, an LLM judge (Gemini 3.6 Flash) checks whether the model's explanation matches a documented bypass closed by $\Delta_2$. The authors also manually annotated all 310 "false acceptances" (cases where a model declared the code safe) to pinpoint where the reasoning failed—specifically looking for the guard shortcut, where a model discusses the guard but never tests if an input can get past it.

Datasets

The authors introduce SteelYourHeart, a benchmark of 195 incomplete security fixes drawn from 136 open-source repositories via the GitHub Advisory Database (published between January 2024 and October 2026).

  • Classes: It spans 24 vulnerability classes, led by authorization bypass (34 cases), path traversal (25), server-side request forgery (16), denial of service (14), cross-site scripting (13), and sandbox escape (12).
  • Severity & Recency: 56% of the advisories are rated high or critical, and 84% (164 cases) were published in 2026.

Unlike prior benchmarks that pair vulnerable functions with fixed ones, every case in SteelYourHeart sits in between: it contains an active guard that is still exploitable.

Key Insights and Ideas

  • Verdicts hide bad reasoning: Flagging code as vulnerable is much easier than finding the actual flaw. Scoring only the binary verdict overstates detection performance by 7.7 to 23.6 percentage points across the four tested models.
  • Everyone takes the guard shortcut: In 1 out of every 3 false acceptances in detection (74 of 223), the model explicitly mentions the guard, does not test it, and declares the code safe. Gemini takes this shortcut most often (68% of its false acceptances).
  • Stronger models dismiss flaws they actually found: Claude Sonnet 5.5 had the highest overall accuracy, yet it also approved the most incomplete patches in review. Why? Because it frequently found the exact bypass, then talked itself out of it—arguing the harm was too small or required a special configuration.
  • Showing the patch can cause regressions: In 22 of the 421 model–case pairs where a model correctly identified a bypass in detection, the same model approved the incomplete fix when shown the patch diff in review—often treating the remaining flaw as "outside the scope" of the patch.
  • Recent bugs are harder: All four models performed worse on 2026 advisories than on 2024–2025 ones (e.g., Sonnet dropped from 83.9% to 68.9%), suggesting prior exposure during training may inflate scores on older bugs.

Key Results

The authors evaluated four models—Claude Sonnet 5.5, Gemini 3.6 Flash, GLM 5.3 Flash, and DeepSeek v4.1 Flash—on all 195 cases:

  • Detection (verdict + matching explanation): Sonnet led at 71.3%, followed by Gemini (59.0%), GLM (49.2%), and DeepSeek (36.4%).
  • Patch Review (verdict + matching explanation): All models improved when shown the initial diff, rising to 77.9% (Sonnet), 76.4% (Gemini), 70.3% (GLM), and 65.6% (DeepSeek).
  • Hardest vs. Easiest Classes: Denial of service was the hardest class in detection (39.3% average correct rate), while authorization bypass was the easiest (75.0%).

Limitations and Future Work

The authors note that SteelYourHeart only evaluates local fixes verifiable within a small code slice, so results may not generalize to bugs requiring whole-repository context. Additionally, because every case is vulnerable, the benchmark does not measure false-positive rates on truly safe code, and its reliance on an LLM judge means some real vulnerabilities outside the $\Delta_2$ reference reasons are scored as wrong. Future work includes prompting or building agent workflows that force models to test guards with concrete inputs, explicitly specifying threat models to prevent models from dismissing valid bypasses, and extending the benchmark to full repositories with executable proofs of concept.

Summary updated

BibTeX
@misc{hao2026steelyourheart,
  author = {Run Hao and Zhuoran Tan},
  title = {{SteelYourHeart: Catching LLMs Taking Shortcuts in Vulnerability Detection}},
  year = {2026},
  eprint = {2612.05531},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.05531},
}
Figure