CoEvo-SQLi: Co-Evolving SQL Injection Detectors via Schema-Grounded Attack Synthesis
Abstract
Pre-execution SQL injection (SQLi) detection must block malicious queries without disrupting benign workloads and keep sensitive queries and schemas within a local trust boundary, requirements that existing defenses only partially meet. Rule- and signature-based systems are lightweight but brittle under obfuscation and semantics-preserving rewrites; learned and LLM-based detectors capture richer query patterns but are typically trained once on a fixed corpus. For small local detectors, such static training raises two problems: variants outside the fixed corpus cannot be absorbed without full retraining, and an undifferentiated budget is spent largely on already-learned, conspicuous patterns while underrepresented variants with unresolved errors receive little. We address both problems with CoEvo-SQLi, a feedback-directed co-evolutionary training framework coupling attack synthesis with multi-round detector updates. In each round, an Attacker synthesizes SQLi examples, guided by Verifier signals indicating which injection clusters should receive more training budget and where to explore further variants; the Defender fine-tunes on the resulting training slice and runs inference on a fixed validation set, whose errors the Verifier converts into next-round feedback. These coupled updates let the Attacker target the Defender's current weaknesses while the Defender learns from the resulting variants. We also introduce SQLi-bench, a schema-grounded benchmark of 48 SQLi clusters for controlled training and evaluation across diverse attack forms. Under a matched training-example budget, CoEvo-SQLi achieves a Matthews correlation coefficient (MCC, ×100) of 92.5 on SQLi-bench, versus 78.0 for an identically configured static fine-tuning baseline; removing feedback-directed synthesis or payload mutation costs 10.5 and 9.2 points, respectively. Its query-only version attains the highest mean MCC on SQLi-bench, rbsqli, and WAF-A-MoLe.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.