arXiv:2611.03742cs.CRNov 2026

Manuscript Offprint

arXiv:2611.03742

Fixed Detectors, Moving Code: How Well Do Static Security Analyzers Hold Up over a Decade of C/C++ Evolution?

Junhua Tang, Zhengsong Zhang. Haipeng Cai

JUNHUA TANG, University at Buffalo, SUNY, USA

ZHENGSONG ZHANG, University at Buffalo, SUNY, USA

HAIPENG CAI, University at Buffalo, SUNY, USA

Static application security testing (SAST) tools are adopted on the expectation that a detector set up today will keep finding vulnerabilities in code written later, including previously unknown vulnerabilities. This expectation is rarely tested. In this paper, we test it on 20,000 vulnerable and fixed C/C++ cases from 1,116 open-source projects with source years 2016–2025, under three CodeQL releases, three Infer releases, and one Semgrep configuration. We conduct three studies in which we progressively control for changes in code composition to isolate SAST tool performance differences associated with code evolution over time: yearly populations, project- and label-matched year pairs, and within-project trajectories. We then trace the largest within-project drops to repair diffs, rule and query predicates, alert locations, and execution logs, and we account for failed, degraded, and costly runs. Under our changed-file case-label scoring, the overall F1 of these tools ranges from 0.066 to 0.478, yet every overall count-based AUROC lies between 0.495 and 0.526. For CodeQL, higher F1 in newer releases is accompanied by nearly parallel increases in recall and false-positive rate, rather than better vulnerable/fixed separation. Across the full project-matched year-pair analysis, the mean later-minus-earlier F1 for CodeQL R2024 is negative at every source-year gap, whereas Infer v1.1 and v1.3 are positive at every gap. In the selected drops, only 6 of 39 CodeQL findings and 2 of 620 Infer findings touch a changed repair line, and 78.96% of Semgrep cases carry parser or timeout diagnostics although every run reports success. Overall, our results show that apparent temporal changes in SAST effectiveness can reflect broader alerting, shifting analysis coverage, or incidental findings as well as genuine losses in defect coverage. Temporal sustainability should therefore be evaluated at the level of a fixed detector condition, with project controls, repair-level evidence, and explicit accounting of failed and degraded analyses.

CCS Concepts: • Security and privacy → Software security engineering.

Additional Key Words and Phrases: vulnerability detection, temporal sustainability

1 Introduction

Static application security testing (SAST) analyzes source or compiled code without running it, so it can flag a weakness before the code ships. The value of that early warning lies in the future. A detector adopted this year is expected to keep flagging the same classes of defects in code that will be written next year, and it matters most when a vulnerability has no identifier, exploit, or patch yet. In one large study, zero-day attacks went undisclosed for 312 days on average [12], and vulnerable code commonly survives in open-source projects for years [1]. A SAST tool cannot know a future zero-day by name, but its queries, abstract domains, and patterns may still cover the defect, provided that the tool can parse, build, and analyze the code in which the defect appears.

Both sides of that interaction change. Programs evolve continuously [43]: languages gain idioms, build systems are replaced, and dependencies move. Historical snapshots can become unbuildable; in one study only 38% of the change history of 100 Java projects could still be compiled [57]. Analyzers change as well, through new engines, query packs, rule sets, and recovery behavior. Noirot Ferrand et al. ran 114 CodeQL versions on 3,993 CVEs and found that 21 detected CVEs were no longer detected after a version change [49]. Most SAST evaluations, however, are cross-sectional. They measure how many known vulnerabilities a fixed tool set finds at one point in time and report

Authors' Contact Information: Junhua Tang, University at Buffalo, SUNY, Buffalo, NY, USA, junhuata@buffalo.edu; Zhengsong Zhang, University at Buffalo, SUNY, Buffalo, NY, USA, zhengson@buffalo.edu; Haipeng Cai, University at Buffalo, SUNY, Buffalo, NY, USA, haipengc@buffalo.edu.

that much is missed [9, 34, 45, 47]. They do not say whether a fixed detector keeps working as the code it analyzes grows older.

Answering that question is harder than it looks. Suppose a detector scores F1=0.30 on code from 2016 and 0.10 on code from 2024. The drop may reflect aging, or it may reflect that the 2024 sample contains different projects, a different label balance, larger files that the parser handles only partially, or more runs that timed out and were silently dropped. The same pitfalls are well documented for learning-based security systems, where random splits and mixed time periods inflate results [4, 51, 52]. SAST adds two more. An alert can disappear because the relevant file was never scanned, and a positive score can come from an alert unrelated to the labelled vulnerability.

This paper studies the temporal sustainability of SAST: under a fixed, documented detector condition, do effectiveness, executability, and cost remain adequate as the analyzed code moves forward in time? We evaluate 20,000 C/C++ vulnerable and fixed cases from 1,116 projects and source years 2016–2025 under seven detector conditions: CodeQL releases from 2021, 2024, and 2026; Infer v1.1.0, v1.2.0, and v1.3.0; and one Semgrep configuration with 170 rules. Three complementary designs separate a change in the code population from a change over time: yearly populations (Study A), exactly project- and label-matched year pairs (Study B), and balanced within-project trajectories (Study C). We then examine the largest within-project drops at the level of repair diffs, alert locations, rule or query predicates, traces, and logs, and we analyze execution failures and cost on deduplicated targets. The main findings are as follows.

  • A higher score is not better detection (§4). F1 ranges from 0.066 (Infer v1.1) to 0.478 (Semgrep), yet every overall count-based AUROC lies between 0.495 and 0.526. Newer CodeQL releases more than double F1 by raising recall and FPR together, Infer's 2024 release outperforms its 2026 release, and one generic Semgrep rule produces 63% of all qualifying findings.

  • Temporal degradation is detector-condition specific (§5). Fixed historical detector conditions exhibit later-year degradation where post-release observations are available. Across the broader project- and label-matched analysis, CodeQL R2024 has negative mean ΔF1\Delta F1 at all nine source-year gaps (up to -0.16), whereas Infer v1.1 and v1.3 are positive at every gap and Semgrep changes little at most gaps. Differences between year pairs are larger than most gap means, so no tool-wide "F1 lost per year" exists.

  • Aggregate effectiveness and within-project temporal trajectories need not agree (§6). Later CodeQL releases have higher F1 but more projects with negative descriptive F1 slopes (37, 74, and 85 of 202), and most flat Infer trajectories are flat only because F1 is zero in every year (144 to 176 of 202 projects).

  • Several selected extreme F1 drops are driven by off-repair or scope-misaligned findings (§7). In the selected drops, only 6 of 39 CodeQL findings and 2 of 620 Infer findings touch a changed repair line, no Semgrep positive reaches the labelled repair, and 11 of 20 Semgrep vulnerable/fixed groups are scored on disjoint files. The genuine misses we found arise from rule predicates that do not encode the defect and from code that never reaches the analysis.

  • A successful run can hide a degraded analysis (§8). Execution status changes in both directions across CodeQL releases (281 vs. 177 targets), Infer turns thousands of empty or failed captures into scored successes, 78.96% of Semgrep cases carry parser or timeout diagnostics under a successful status, and two range-analysis queries alone can exhaust a 12-hour budget.

Contributions. This paper makes four contributions.

  • A definition of SAST sustainability that covers effectiveness, executability, and cost, and that ties the property to prospective vulnerability discovery (§2.2).

  • A three-estimand design that separates yearly ecosystems, matched populations, and within-project trajectories, with explicit units of inference (§3.5).

Fixed Detectors, Moving Code: How Well Do Static Security Analyzers Hold Up over a Decade of C/C++ Evolution?

3

Table 1. The three analyzers, their analysis style, and the components through which code evolution or tool evolution can change their results.

ToolAnalysis styleInput it needsTime-sensitive components
CodeQLRelational database of the program; declarative QL queries over syntax, control and data flow [5, 24]Extraction from a traced build or buildless extractionExtractor and compiler discovery; query packs and their models; query evaluation cost
InferCompositional analysis with procedure summaries, rooted in separation logic and bi-abduction [16, 17, 50]Captured compilation (build interception)Build capture and dependency availability; checker set and models; analysis budget
SemgrepStructural pattern matching with constant propagation and intrafile taint rules [54]Source files, no buildParser coverage of constructs; rule definitions and severities; per-rule timeouts
  • A large longitudinal evaluation of seven detector conditions from three analyzer families over 20,000 cases, 45 year pairs, 100 resamples, and 202 projects (§4–§6).

  • A triangulation of scores with repair diffs, alert locations, rule and query predicates, traces, controlled local experiments, and execution ledgers, yielding concrete guidance for tool builders, practitioners, and benchmark designers (§7–§9).

Paper organization. Section 2 explains what can age in a SAST tool and gives a motivating example. Section 3 describes the corpus, the seven detector conditions, the scoring rule, and the three studies in enough detail to reproduce them. Sections 4–8 answer the five research questions, one tool at a time, and report every per-year, per-gap, and per-cohort table we have. Each results section ends with a short boxed finding. Section 9 draws the results together, Section 9.5 discusses threats to validity, and Section 10 relates the study to prior work.

References (31)