arXiv:2609.06840cs.CRSep 2026

Manuscript Offprint

arXiv:2609.06840

WAPP: Safe Learning of Positive Security WAF Policies from Live Traffic

Heba Osama, Zeyad Ahmed, Mohamed Amgad, Ahmed Saafan, Jana Elfeky, Mariam Abdelati, Haitham Ghalwash

Abstract

Web Application Firewalls (WAFs) mainly rely on signatures to detect known attacks, which can leave gaps against modified or previously unseen payloads. Positive security provides a complementary approach by learning legitimate traffic and blocking inputs that fall outside the learned profile. However, learning directly from live traffic can be unsafe when malicious requests contaminate the training data. This paper presents the Whitelisting Autonomous Policy Producer (WAPP), a framework that combines trust filtering, deterministic rule synthesis, confidence scoring, and validation before enforcement. WAPP is evaluated on three controlled applications using a live Coraza and OWASP Core Rule Set (CRS) stack. Results show that, on the tested DVWA username field, unfiltered learning becomes Degraded at 0.2% poisoned traffic and Broken at 0.5%, while the evaluated free text field can admit malicious inputs even without poisoning. On the frozen poisoning dataset, the ablation configuration with all seven candidate signals improves the measured poisoning resilience from 53% to 90%, compared with 62% for the Kruegel-Vigna baseline. The deterministic synthesizer provides attack blocking comparable to the tested language model without model inference cost. WAPP blocks confirmed CRS bypasses on constrained fields, while free text inputs remain a precision challenge that requires character level operator control.

Keywords: Web application firewall; Positive security; Allowlisting; Data poisoning; Adversarial machine learning; Security policy generation

1 Introduction

A Web Application Firewall (WAF) inspects Hyper-text Transfer Protocol (HTTP) traffic before it reaches a protected application. Traditional WAFs commonly use rules and signatures to identify known malicious patterns [1]. This negative security approach is reactive because modified payloads, encoding techniques, and other evasion variants may fall outside existing rule coverage [2]. Effective protection therefore requires rules to evolve as applications and attack techniques change [3].

Positive security reverses this logic by defining legitimate request behavior and rejecting values outside it. Statistical profiling of web request parameters can characterize properties such as value length, character distribution, token structure, and attribute presence [4]. A learned allowlist can use these properties to define the expected shape of individual fields without relying on recognition of a specific attack signature. For constrained inputs, this can provide strong protection against values outside the learned profile, although an overly restrictive profile may also block legitimate inputs.

The main challenge is operational. Manually creating and maintaining allowlist policies becomes difficult as applications and legitimate traffic evolve. Recent studies have demonstrated WAF detection based on

machine learning using benchmark data and HTTP traffic evaluated in real time [5, 2]. However, these studies focus mainly on detecting or classifying malicious requests rather than safely learning enforceable positive security policies from live traffic. When attackers can influence the observations used for learning, data poisoning becomes part of the threat model [6]. This motivates evaluating both the trustworthiness of the training traffic and the behavior of the resulting policy in a live enforcement path.

This paper presents the Whitelisting Autonomous Policy Producer (WAPP), a framework that transforms live traffic into enforceable positive security WAF policies through traffic profiling, trust filtering, deterministic rule synthesis, confidence scoring, and validation before enforcement. WAPP is evaluated under adversarial conditions on three controlled applications through a live Coraza reverse proxy using the Open Worldwide Application Security Project (OWASP) Core Rule Set (CRS). The findings are limited to the applications and field types evaluated.

The work is organized around five research questions (RQs):

  • RQ1 – Learning safety: Under what conditions does learning allowlist policies from observed live traffic become unsafe?

  • RQ2 – Trust filtering: Can trust filtering re-

cover safe policy learning from poisoned traffic, and which signals contribute most to its effectiveness?

  • RQ3 – Rule synthesis: Given trusted traffic, does rule synthesis using a language model provide an advantage over deterministic statistical synthesis?

  • RQ4 – Confidence and enforcement: How can generated rules be scored and thresholded before enforcement, and how does this scoring relate to false positives and missed attacks?

  • RQ5 – Security benefit: Can learned positive security policies block attacks missed by WAF signature rules, and at what cost to legitimate traffic?

Together, these research questions define the scope of the study. The main contributions addressing them are summarized as follows:

  1. Adversarial analysis of open population allowlist learning. The analysis identifies conditions under which learning positive security policies from live traffic becomes unsafe. On the tested DVWA username field, the learner becomes Degraded at 0.2% poisoned traffic and Broken at 0.5%, while the evaluated free text field admits attacks even without poisoning.

  2. Trust filtering without a clean training seed. On the frozen poisoning dataset, the ablation configuration with all seven candidate signals improves measured poisoning resilience from 53% to 90%, compared with 62% for the Kruegel-Vigna baseline [4]. Exact Shapley attribution is used to quantify the contribution of each signal.

  3. Controlled comparison of deterministic and language model rule synthesis. Under identical trusted inputs, deterministic synthesis provides attack blocking comparable to the tested language model without model inference cost and enforces closed parameter sets in six of seven tested rules.

  4. Evidence based confidence scoring with live validation. Candidate rules are scored and tested in the live WAF before enforcement. The results show that the score mainly reflects the amount of supporting evidence rather than policy safety, making representative validation necessary.

  5. Measured additional coverage beyond signature rules. Learned positive security rules block confirmed OWASP CRS bypasses on constrained fields, while experiments on rich free text identify false positives as the main limitation and evaluate character level operator control as a precision mechanism.

The remainder of this paper is organized as follows. Section 2 reviews related work on WAF security, application learning, machine learning based WAFs, adversarial learning, poisoning defenses, language model based policy generation, and WAF evasion. Section 3 presents the WAPP methodology, including the system architecture, research design, evaluation metrics, threat model, trust filtering, rule synthesis, confidence scoring, validation, and signature bypass evaluation. Section 4 presents the experimental results corresponding to the five research questions. Section 5 discusses the main findings and their implications. Finally, Section 6 concludes the paper and outlines directions for future work.