WAF
Web Application Firewall — inspects and filters web traffic at Layer 7 (the application layer).
Rule Set
The set of detection patterns a WAF uses to identify malicious requests — updated regularly to cover new attacks.
Positive Security
Allowlisting approach — only permits requests matching an expected pattern, blocking everything else.
Negative Security
Blocklisting approach — permits all traffic except known attack signatures.

How a WAF works

A WAF sits between the internet and a web application, acting as a reverse proxy. Every HTTP request passes through the WAF before reaching the application server. The WAF inspects the full request — URL, headers, cookies, query parameters, and body — against a set of rules, then makes a decision:

  • Allow: The request appears legitimate and is forwarded to the application.
  • Block: The request matches a known attack pattern and is dropped, returning a 403 to the attacker.
  • Log/Alert: The request is suspicious but not definitively malicious — it is forwarded but an alert is raised for security review.
  • Challenge: Some WAFs present a CAPTCHA or JavaScript challenge to verify the client is a human browser rather than an automated scanner.

Types of WAF deployment

  1. 1
    Cloud-based WAF (SaaS) — Operated by a third-party vendor (Cloudflare, Akamai, AWS WAF, Imperva). Traffic is routed through the vendor's network before reaching your infrastructure. Easy to deploy, globally distributed, includes DDoS mitigation. No hardware to manage. The most common choice for web applications today.
  2. 2
    Hardware WAF (Appliance) — A physical device installed in the data centre between the internet edge and application servers. High performance, no external traffic routing. Used by large enterprises and organisations with strict data sovereignty requirements. Higher upfront cost and maintenance burden.
  3. 3
    Software WAF — Runs as software on the same server as the application (e.g., ModSecurity for Apache/Nginx, or built into frameworks). Lower cost, but adds processing overhead to the application server and doesn't provide DDoS absorbing capacity.

What a WAF blocks

A well-configured WAF can detect and block a wide range of web application attacks:

  • SQL injection: Patterns like ' OR 1=1--, UNION SELECT, and encoded variants are matched against rule sets like OWASP ModSecurity Core Rule Set (CRS).
  • Cross-site scripting (XSS): Requests containing <script> tags, JavaScript event handlers, or encoded script patterns in parameters or bodies.
  • Directory traversal: Requests containing ../ sequences attempting to access files outside the web root.
  • Application-layer DDoS: Rate limiting and bot detection to block floods of HTTP requests, credential stuffing, and content scraping.
  • Known CVE exploits: Rule updates for newly disclosed vulnerabilities (virtual patching) — providing protection even before the application itself is patched.
Virtual patching: One of the most valuable WAF use cases. When a critical vulnerability is discovered (like Log4Shell), a WAF rule can be deployed within hours to block exploit attempts — long before the application vendor releases a patch or your team can deploy it. This "virtual patch" buys critical time.

WAF limitations

A WAF is a powerful layer but not a complete solution:

  • Not a substitute for secure code: A WAF can be bypassed with sufficiently clever encoding, obfuscation, or novel attack patterns not covered by existing rules. Vulnerable code must still be fixed.
  • Business logic attacks: WAFs cannot detect attacks that abuse legitimate application functionality — for example, a user exploiting a broken authorisation check to access other users' accounts. These look like valid requests.
  • Encrypted traffic: A WAF must be able to decrypt HTTPS traffic to inspect it. Misconfigured TLS termination can create blind spots.
  • False positives: Overly aggressive rules block legitimate traffic. Tuning is required, particularly for applications with unusual input patterns.
$6.4B
Global WAF market in 2023 — projected to reach $14B by 2030, driven by API protection and cloud adoption.
OWASP CRS
The OWASP ModSecurity Core Rule Set is the most widely deployed open-source WAF rule set — covering OWASP Top 10 and more.
PCI-DSS
Requirement 6.4 mandates a WAF for any public-facing web application that processes cardholder data — making WAF deployment mandatory for e-commerce.
Learn WAF evasion and defence in CEH v13

CEH v13 covers WAF bypass techniques from the attacker's perspective and defensive WAF configuration — giving you both sides of the equation.

Explore CEH v13