1. Introduction
Software vulnerabilities are disclosed faster than they are remediated. Large language models (LLMs) that read code and propose edits are an obvious tool for closing this gap, and a growing literature reports that models can, in some fraction of cases, produce a fix that resembles the one a developer committed [
1,
2,
3]. This has produced benchmarks and leaderboards that rank models by how often their output matches, or is textually similar to, a reference fix.
Two questions hide inside a single “fix rate.” The first is whether a patch removes the vulnerability; the second is whether it preserves the program’s behaviour. A patch can do the first without the second: it can shut down the vulnerable path and, in doing so, break legitimate functionality. This is the security-repair instance of the classical overfitting problem in automated program repair (APR), where a patch passes the tests used to guide repair but breaks untested-but-desired behaviour [
4,
5]. We call this security form over-fixing. It is invisible to similarity metrics and to any check that asks only “was the CWE removed?” From an operational standpoint, an over-fixing patch is not a fix: it trades a security bug for a functional regression.
But there is a subtler trap, and it is the one this paper is really about. Because most real vulnerability corpora provide no tests, researchers increasingly measure correctness with a second LLM acting as a judge. If that judge is itself unreliable on the very axis that distinguishes a fix from an over-fix, namely functional preservation, then a study can report a dramatic “over-fixing” or “fix-rate” number that is an artefact of its measuring instrument rather than a property of the patches. A recent audit found that every one of the 72 LLM-for-security papers it examined exhibited at least one such methodological pitfall [
6]. We therefore treat the measurement instrument as an object of study, not a given.
We evaluate eight commercial and open LLMs on 116 real vulnerable JavaScript functions, scoring each patch on the two axes above. At scale, we use a reference-based LLM judge; we then calibrate that judge against an execution oracle on a purpose-built benchmark of runnable vulnerabilities, and we report their agreement. This calibration is what lets us separate real findings from instrument artefacts. Finally, we push the calibration onto real repository-scale code, running 254 patches across 33 real Java CVEs under full Maven execution.
Our contributions are as follows: (1) An execution-grounded characterisation of LLM JavaScript vulnerability patching that reports per-model correctness with confidence intervals and finds that even the best model fixes only a minority of the vulnerabilities. (2) The demonstration that an LLM judge cannot reliably measure functional preservation. On a runnable benchmark it reports over-fixing several times as often as execution finds it (precision 5–10%, recall 12–38%), and even its more reliable verdict, whether a patch is correct, erodes on hard real code. Over-fixing itself is a genuine but, when measured by execution, uncommon failure mode: among vulnerability-removing patches it occurs in 7.1% on the benchmark, 8.9% across three languages, and 4.2% on Java (1 of the 24 neutralising patches, or 1 of 254 overall), and each of these figures is a lower bound. Its apparent concentration in one weakness class is an artefact of a single constructed test. (3) Confirmation that textual similarity is uninformative about correctness (). (4) A cost analysis showing that cost-efficiency inverts the accuracy ranking. (5) A repository-scale replication on 254 patches across 33 real Java CVEs under full Maven execution. There, the commercial-over-open gap holds under a model-level test, though it is confounded by model scale and memorisation of pre-cutoff fixes, and both judges inflate the over-fix rate (28 and 43 labels to execution’s one). Their correctness estimates diverge in opposite directions (one over-credits at , the other under-credits at ), so inter-judge agreement itself breaks down on hard code. In practice, security-patch evaluation must run the code in order to measure any such rate. We release the evaluation harness, the judge prompts, and the executable benchmark.
We organise the study around four questions, plus a repository-scale replication.
RQ1: How often do current LLMs correctly fix real vulnerabilities, and how do commercial and open models compare?
RQ2: How common is over-fixing, and can an LLM judge measure its incidence?
RQ3: How reliable are the two scalable correctness proxies the field relies on (textual similarity and an LLM judge) compared to execution?
RQ4: How do accuracy and cost trade off across models? We then ask whether the answers carry over to real, repository-scale code (
Section 4.5).
2. Related Work
LLMs for vulnerability repair. Pearce et al. [
1] first studied zero-shot vulnerability repair with LLMs and warned that a passing regression test is a weak proxy for a correct fix. Fine-tuning approaches (VulRepair [
2], VulMaster [
7]) report exact-match or CodeBLEU against the developer fix; Wu et al. [
3] benchmark models on reproducible Java vulnerabilities and find that even the best model repairs only about 20% of them. Agentic pipelines [
8] reach a similar ceiling.
Over-fixing is APR overfitting, specialised to security. The phenomenon we study is not new to program repair. Smith et al. [
4] showed that using the same tests to both guide and evaluate repair fails to distinguish correct patches from ones that “overfit the available tests and break untested but desired functionality”. Qi et al. [
5] then distinguished plausible patches, which pass the suite, from correct ones, and found that most generate-and-validate patches are plausible-but-incorrect, often equivalent to deleting functionality. The two forms differ mechanically: classical APR overfitting arises when a search games a weak test suite, whereas our patches are single-shot generations with no test in the loop, so the security form is better described as over-restriction (a guard that rejects legitimate inputs) than as suite-gaming. Our contribution is not to discover over-fixing but to (a) quantify its security form per weakness class on real CVEs and (b) show that the LLM judges now used to measure it cannot see it reliably.
Benchmarks and joint verification. Commit-derived corpora (CVEfixes [
9], BigVul [
10]) are noisy, since 40–75% of a fixing commit is unrelated refactoring [
11], which motivated cleaned derivatives (CleanVul [
12], used here) and re-labelled sets (PrimeVul [
13]). Execution-based benchmarks are the current best practice, from repository-scale issue resolution (SWE-bench [
14]) to security-specific suites. PatchEval [
15] runs both security PoC tests and functionality tests over 1000 CVEs and explicitly observes patches that pass security tests but fail functionality tests (that is, over-fixing), arguing against similarity-only scoring. SecRepoBench [
16] sweeps 19 models with execution and memorisation control, and CWEval [
17] jointly scores functionality and security for code generation. Secure-code-generation benchmarks (CyberSecEval [
18], SecurityEval [
19]) measure a model’s propensity to emit insecure code with static detectors. We build on this execution-based tradition. Our distinct focus is not another fix-rate leaderboard but the reliability of the correctness signal itself. Concretely, we ask whether an LLM judge, the scalable alternative to execution, can measure functional preservation, and we add a per-CWE over-fixing cut and a cost-per-correct analysis.
Measuring patch correctness. The plausible-vs.-correct distinction and its overfitting threat are surveyed in [
20], extending a line of automated patch-correctness assessment [
21,
22] grounded in execution-based APR benchmarks such as Defects4J [
23]. Similarity metrics (BLEU, CodeBLEU [
24], CrystalBLEU [
25]) are cheap but track functional correctness weakly. LLM-as-judge for patch correctness is scalable but prompt-sensitive and biased [
26]. Code-specific judge methods such as ICE-Score [
27] and CodeJudge [
28] instruct an LLM to score code directly, and LLM judges more broadly exhibit position, verbosity, and self-enhancement biases [
29,
30], including a documented preference for their own outputs [
31]. Our results add direct evidence of a specific, consequential failure: LLM judges inflate the over-fix rate, and inter-judge agreement does not certify validity. The nearest multi-model, per-CWE studies (LLM4CVE [
32], VulnLLMEval [
33]) score with similarity and do not isolate over-fixing or calibrate their signal against execution.
5. Discussion
The results tell an evaluation-methodology story with a practical edge. LLMs correctly fix only a minority of isolated-function JavaScript vulnerabilities, commercial models roughly double the rate of open ones, and the accuracy ranking inverts once cost is considered. The more important finding, however, concerns measurement. Both of the scalable proxies the field leans on fail on the axis that matters: textual similarity is uninformative about correctness (), and an LLM judge cannot reliably tell whether a neutralising patch preserved functionality (functional for both judges; over-fix precision 5–10% and recall 12–38%). Had we trusted the judge, we would have reported that a majority of LLM security patches break the code; execution puts that figure far lower. On a common denominator, over-fixing among vulnerability-removing patches is 7.1% on the constructed benchmark, 8.9% across the three-language run, and 4.2% on the full-regression Java corpus (1 of 254 patches overall). Every oracle places it in single digits, and each figure is a lower bound under that oracle’s own test coverage, so over-fixing is a genuine but uncommon failure mode rather than the norm. Its rarity is a secondary result; the central finding is that neither similarity nor an LLM judge measures the functional-preservation rate reliably, and that only adequately tested execution does.
One qualification softens the prescription. As
Section 4.3 shows, a judge that cannot measure a rate can still rank models: judge and execution agree on the per-model correctness order at
on the benchmark, and the two judges agree with each other at
on Tier-1. A practitioner choosing between models may therefore reasonably use a judge, whereas measuring an over-fix or correctness rate requires execution. The ranking property is itself difficulty-dependent. It weakens to
on the hard Java corpus, where the judges also stop agreeing with each other, so it should be relied on for coarse model selection rather than fine distinctions.
This bears directly on deployed auto-patching assistants (e.g., pull-request bots that generate security fixes). Such systems should gate on a functional oracle, not on CWE-removal alone, and evaluations of them should not substitute an LLM judge for execution on the functional axis. Where projects lack adequate tests (the common case, and the reason our corpus had none), human review and property-based or differential testing are the practical fallbacks. Note that the calibration that makes the judge usable here does not transfer to an untested target codebase, so a team that cannot execute also cannot know its own local over-report rate. The failure modes split across stakeholders: a security team most fears an INEFFECTIVE-but-plausible patch (the vulnerability silently remains); a maintainer most fears an OVER-FIX (a silently broken feature in an auto-generated PR). Both evade the similarity and CWE-only checks the field commonly uses.
A reporting-integrity corollary follows from treating the judge as gameable. Because a judge can be satisfied without the code being fixed, and because LLM evaluators favour their own outputs [
31], a judge-based fix rate is not merely imprecise but optimisable. A vendor can tune a patcher to please a judge, and a vendor that uses its own model as both patcher and judge inflates its numbers through self-preference. We therefore recommend that comparative fix-rate claims be execution-backed, that any unavoidable judge come from a provider family different from that of the patcher, and that self-judged fix rates be treated as unreliable by reviewers and procurement.
Our findings describe a single-shot, offline evaluation, and it is worth being explicit about how they change under multi-turn agentic or execution-guided repair. In a test-driven loop the model proposes a patch, the suite runs, and failures are fed back until the tests pass, as in agentic issue-resolution and CVE-repair settings [
8,
14]. Two consequences follow. First, such a loop presupposes exactly the executable oracle whose absence motivates an LLM judge in the first place, so it is not a substitute for our prescription but an instance of it: where tests exist, run them. Second, and more interesting, the loop changes what the judge is. An offline judge emits a terminal verdict that nothing downstream can contradict, which is the setting where our results say it should not be trusted to measure a rate. Inside a feedback loop, the same model acts as an interactive verifier whose proposals are continuously falsified by the suite, so its errors become recoverable rather than final: a false over-fix label costs an extra iteration instead of a wrong number in a results table. That reframing does not rehabilitate judge-reported rates, because the loop’s authority still comes from execution, but it does suggest the judge’s productive role is generative (proposing what to try next and ranking candidates) rather than evidentiary. It also raises a question our design cannot answer: whether a judge that has seen failing test output becomes well calibrated on the functional axis, which would require a corpus with both adequate tests and repository context. We flag it as the natural next experiment.
Two caveats bound even the surviving claims. First, our correctness figures are single-shot; an iterative, test-in-the-loop pipeline would plausibly fix more and over-fix less, so 23% should be read as a single-shot operating point rather than a deployable ceiling. Second, the models saw one function plus a CWE, whereas the developer had the whole repository; some of the low correctness therefore reflects a lack of context rather than a pure model limitation, which is itself an argument for repository-level evaluation.
6. Limitations and Threats to Validity
Language coverage. The large-scale Tier-1 corpus (CleanVul) covers only JavaScript and web code; the execution benchmark spans JavaScript, Python, and Go, and we additionally run 254 patches across 33 real Java CVEs (Vul4J) under full Maven execution (
Section 4.5). That real-Java corpus is itself restricted to single-production-file fixes and, within Vul4J, to CVEs whose projects build cleanly in the pinned container. Several classes fall outside our coverage entirely: multi-file fixes, the remaining Vul4J CVEs, memory-safety classes in C/C++, and input-independent classes such as weak cryptography, insufficient entropy, and information exposure. The calibrated claims are therefore confined to the guard and input-validation weaknesses the benchmark exercises, and the over-fixing mechanism we identify, fixing by adding a guard or check, is plausibly specific to those classes. The benchmark cases are synthetic minimal reproductions. The released harness defines a superset of cases; the 18 behind the 144-patch calibration and the 32 behind the three-language run are the subsets recorded in the result databases. The Python and Go suites largely re-implement the same core scenario set as the JavaScript suite, so the cross-language runs test the judge’s robustness to a scenario’s implementation rather than sampling independent vulnerabilities. We accordingly reserve the external-validity weight for the real Vul4J corpus. We note that PatchEval’s public release provides function pairs but not its executable sandboxes, so large-scale real-CVE execution across additional languages remains dependent on such infrastructure.
Judge-based scale, execution-calibrated. Tier-1 correctness is judged, not executed; we calibrate two cross-family judges (/ correct, / functional) and we report correct rates as calibration-dependent estimates and never report a judge’s over-fix figure as established fact. The calibration benchmark is constructed (, 18 vulnerabilities across two languages), and its cases are easier than the real corpus, so is likely optimistic for real functions; a still-larger execution set drawn from the corpus would further tighten the estimate. The two central claims differ in kind. That both judges inflate the over-fix rate is the robust, cross-family claim (benchmark precision 5–10%; on Java 28 and 43 over-fix labels to execution’s one). That no single judge measures correctness reliably on hard code is supported differently: on the 254-patch Java corpus the primary judge over-credits (), while the cross-family judge under-credits (), and the two agree with each other only at , so the “high-precision-on-CORRECT” property is judge-specific, not a general guarantee.
The execution oracle is parameterised by test strength, on both axes. Functional preservation is decided by a single functional test on the constructed benchmark and by the full regression suite on Vul4J, and neutralisation is decided by a single proof-of-concept on the benchmark and by the project’s proof-of-vulnerability test on Vul4J. A single functional test can miss a genuine regression, so the benchmark’s 7% over-fix rate is a lower bound under a weak oracle, and CORRECT on the benchmark is correspondingly an optimistic estimate. The security axis is symmetric: a single proof-of-concept establishes only “not vulnerable to this payload”, so NEUTRALISED (and hence CORRECT) may be over-credited there too. A consequence we state plainly: where a weak-recall benchmark oracle disagrees with a judge, we cannot always sign the error, because the judge may catch a regression the one test does not exercise. The single-PoC neutralisation criterion is weakest for classes with many attack variants, such as server-side request forgery (bypass via DNS rebinding or IP encodings), prototype pollution (several pollution vectors), and ReDoS (a length cap that defeats one input). For these classes, the NEUTRALISED, and hence CORRECT, rates reported in
Table 4 are correspondingly optimistic, so the single-PoC weakness affects the RQ1 correctness figures and not only the over-fix rate. The SSRF case in particular models the fetch target as an in-memory allow-list lookup rather than a live outbound request, so its verdict reflects the guard logic and not network-level defences. The CSRF over-fix cell is the clearest functional-side artefact: its functional test hard-codes one token-passing interface, so a correct guard that reads the token differently throws on that single call and is mislabelled as an over-fix, which is an interface artefact of the constructed oracle rather than a regression. We therefore treat “only execution measures functional preservation” as “only adequately tested execution does”. The generality of the judge-over-reporting finding rests on the convergence of the two-judge, three-language, and full-regression-suite Java evidence, where the two judges label 28 and 43 over-fixes to execution’s one, rather than on any single benchmark cell.
Prompt robustness. Beyond varying the model, we re-scored the 144-patch benchmark with a structurally different judge prompt that drops the token-level reference comparison and explicitly instructs the judge that a check rejecting only malicious or invalid inputs is functionality-preserving. The over-estimation persists: the variant still over-labels over-fixing (precision 3/20 = 0.15) with a comparably low functional-axis , so the effect is not an artefact of one prompt. (This prompt-variant re-scoring was run separately and its per-label judgements are not persisted in the released databases; we flag it as an auxiliary check rather than a result reproducible from the released data.) Varying the model likewise rules out an explanation based on a weak or small judge, since the frontier GPT-5.2 judge is, if anything, worse on the functional axis. A still-broader prompt sweep would strengthen this further.
The commercial-over-open gap is confounded, and stopping was not pre-registered. These eight models are a purposive sample chosen to span the commercial/open and large/small axes, not a random draw from any population of models, so the contrast is a comparison among the models we selected and supports no general claim about open-weight systems. The class contrast is entangled with model scale, provider family, differential memorisation of public fixes (the corpus predates model cutoffs), and sampling temperature (the three commercial reasoning models run at their non-zero default while the open models run at 0). The classes also overlap: individually, Haiku (commercial) sits below DeepSeek (open). With four models per class the effective unit is the model, not the patch. Because the model is the natural unit, we also ran a model-level test on the four-per-class means. The gap is clear on Java (Welch , Mann–Whitney ) but weaker at Tier-1, where the Welch is significant, while the rank-based reaches only one-sided significance (two-sided ); the Tier-1 evidence therefore rests mainly on the clustered bootstrap and the parametric test. A further confound is specific to the judged Tier-1 rates. The primary judge over-credits commercial patches more than open ones: on Java its judged correct rate is 0.40 for commercial versus 0.09 for open, a judged gap of 0.31 against execution’s 0.13. The magnitude of the Tier-1 commercial-over-open difference is therefore partly a judge plausibility bias, even though the direction is confirmed by execution on Java. With that replication the aggregate claim stands, but it should not be read as an effect of openness per se, and memorisation in particular means some of the gap may reflect recall of public fixes rather than repair. The Tier-1 corpus is also concentrated in one weakness class, with CWE-79 (XSS) making up 41% of attempts (25 CVEs), so the RQ1 rates are XSS-weighted. The commercial-over-open gap holds both within XSS and within the remaining classes. The Tier-1 run was terminated at 922 of 1280 planned attempts for reasons unrelated to the results (a compute limit), leaving balanced per-model denominators (111–116); that stop was not outcome-contingent. The Java sweep of 33 single-file Vul4J CVEs, by contrast, was stopped once the commercial-over-open contrast reached significance. That is optional stopping, and it inflates the Type-I error of every test computed on that Java snapshot, the bootstrap interval and the model-level contrast alike. We therefore rest the commercial-over-open inference on the Tier-1 replication, whose stop was not outcome-contingent, and read the Java gap as corroborating rather than independently confirming. Neither run followed a pre-registered rule.
Pseudoreplication. Per-CWE Tier-1 cells rest on few distinct CVEs (e.g., CWE-918 and CWE-352 on two CVEs each); we therefore ground per-CWE claims in the Tier-2 execution benchmark and report distinct-CVE counts. Absolute per-CWE Tier-1 rates should be read with this in mind.
LLM-to-LLM ground truth. The reference fixes come from an LLM-cleaned corpus and are compared by an LLM judge, which is exactly the chain our thesis warns against. The execution oracle breaks that chain, but it is small; wider human verification of reference fixes is future work.
Contamination, cost, single-shot. The corpus predates model cutoffs, so memorisation cannot be separated from reasoning [
38]. Dollar costs depend on listed prices; we release token counts. Generation is single-shot: each model produces one patch per function, at temperature 0 where the provider permits it and at the provider’s non-zero default for the three commercial reasoning models that reject a temperature setting (
Section 3.2). We considered multi-sample estimation, either pass@
k or averaging over repeated draws, and did not adopt it, because the budget bought either repeated sampling on a small corpus or single-shot coverage of a large one, and coverage was worth more for the judge-calibration question this study asks. That choice has a consequence for the intervals we report, which we want to state plainly. The Wilson 95% intervals in
Table 2 describe binomial sampling over functions. They answer one question: how much would this rate move on a different sample of vulnerabilities? They do not include generation stochasticity. For the three models running at a non-zero default, they therefore understate total uncertainty by an unmeasured amount, and a re-run over the same corpus would not land on exactly the same point estimate. We did not measure run-to-run stability of the outcome labels, so we cannot bound that component. It is an unquantified source of label noise, it affects the commercial models asymmetrically, and it is a further reason to read adjacent-model orderings as indicative rather than strict. It does not bear on the central judge-calibration result, which compares scorers on one fixed set of patches: judge and oracle see identical generations, so any generation noise is common to both and cannot manufacture the reliability-versus-validity gap. (Self-bias, a first-round concern because the primary judge is an evaluated model, is addressed by the cross-family non-Claude judge, which returns a slightly lower correct rate).
7. Conclusions
Large language models correctly fix only a minority of isolated-function JavaScript vulnerabilities, and the choice of model trades accuracy against cost. This low fix rate persists, with the same commercial-over-open gap, across 254 patches on 33 real Java CVEs scored by full Maven execution. The paper’s central lesson, however, is about evaluation: an LLM judge cannot reliably measure functional preservation. Both a Claude and a cross-family GPT judge report over-fixing far more often than execution confirms, at 28 and 43 Java labels to execution’s one. On Java most of those labels fall on patches that never compile, so the judge is failing to see dead-on-arrival patches as much as it is inventing regressions in working code. On hard real code their correctness estimates also diverge in opposite directions, one over-crediting and the other under-crediting, so their agreement with each other breaks down and strong agreement on easy code gives false confidence. Over-fixing itself, that is, removing a vulnerability by breaking functionality, proves uncommon rather than the norm once execution decides the question: single-digit percentages of vulnerability-removing patches across oracles, 1 of 254 at repository scale, and a lower bound throughout. Neither textual similarity nor an LLM judge can measure its rate reliably. Only execution, with adequate functional tests, measures it; a judge may still be used to rank models, not to quantify a rate. We therefore argue that security-patch evaluation should run the code to measure a rate, report uncertainty rather than point estimates, and weigh cost per correct patch. We release the evaluation harness, the judge prompt, the executable benchmark, and the resumable real-Java (Vul4J) execution runner so that such evaluations become routine.