GenWebSec: Adaptive Web Application Firewall Hardening with Co-Evolving LLM Attack and Defense Agents
Abstract
Large language models (LLMs) enable attackers to rapidly generate and adapt exploit payloads in response to defensive updates, outpacing manual web application firewall (WAF) rule maintenance. Evaluating automated defenses solely against static attack corpora leaves open whether synthesized rules remain compact and effective when attackers adapt. We present GenWebSec, an execution-grounded framework that pairs LLM attack and defense agents in a closed WAF hardening loop. Generated exploits are validated through live application execution and WAF replay; the defender then synthesizes rules individually or in groups under coverage-checked admission and strict benign false-positive bounds before renewed attack search challenges the updated defense. Across six custom SQL injection (SQLi) and cross-site scripting (XSS) targets protected by ModSecurity WAF with OWASP Core Rule Set (CRS) 4.29.0, 78.0-99.6% of application-valid payloads bypassed CRS, and every confirmed bypass also evaded Coraza and BunkerWeb WAFs under the same ruleset. On matched fixed corpora, grouped synthesis reduced median rule counts from 93.5-297 (per-payload) to 1-3 per page while blocking 99.6-100% of bypasses. Under iterative adaptive hardening, renewed search found post-update bypasses in 19 of 60 runs, yet grouped hardening converged to a median of one rule per run (range 1-4), blocked 2,420 of 2,421 in-loop bypasses, and kept mean added false positives at or below 0.28%. Frozen rules generalized across attack models (blocking 96.3-100% of attacks from a different LLM) and transferred unchanged to unseen applications (bWAPP and OWASP Juice Shop), blocking 89.4-94.9% of SQLi and 97.6-97.7% of XSS bypasses (on bWAPP) with zero added false positives on external benign traffic.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
Related papers
PvP: Intent-Conditioned Anomaly Detection Against Tool Poisoning Attacks in Agentic AI
Shared title terminologycs.CRMax de Leeuw, Cristoffer Leite, Indika Kumara
Multi Surface Attack: An Agent Is Only as Safe as Its Weakest Surface
Shared title terminologycs.CRMd Touhidul Islam, Khan Thamid Hasan, Md Shah Imran Shovon et al.
Data Poisoning Attacks and Defenses to Local Differential Privacy Protocols: A Survey
Shared title terminologycs.CRXinyu Li, Xuebin Ren, Shusen Yang et al.
Towards Computational Robustness of Latent Diffusion Watermarking Against Removal Attacks with Adaptive Detector Access
Shared title terminologycs.CRDe Zhang Lee, Ee-Chien Chang
Assessing the Robustness of Defense Frameworks Against Data Attacks on AI Systems
Shared title terminologycs.CRVishnu Kurnala, Nelly Elsayed
Deterministic Runtime-Adaptive CAN Routing Diversity for Replay Attack Mitigation
Shared title terminologycs.CRAshwin Kulkarni, Aditi Ramadwar