---
title: "WAF (web application firewall)"
description: "WAF explained: what a web application firewall inspects, where to put it (cloud, server, plugin), virtual patching and its limits on a WordPress site."
language: "en"
locale: "en-US"
type: "definition"
canonical: "https://www.wp-feint.com/glossary/waf/"
published: "2026-10-28T08:00:00+00:00"
modified: "2026-11-22T12:08:52+00:00"
translations:
  en-US: "https://www.wp-feint.com/glossary/waf/index.md"
  fr-FR: "https://www.wp-feint.com/fr/definitions/waf/index.md"
  es-ES: "https://www.wp-feint.com/es/glosario/waf/index.md"
  de-DE: "https://www.wp-feint.com/de/glossar/waf/index.md"
  it-IT: "https://www.wp-feint.com/it/glossario/waf/index.md"
  pt-BR: "https://www.wp-feint.com/pt/glossario/waf/index.md"
  nl-NL: "https://www.wp-feint.com/nl/woordenlijst/waf/index.md"
---

# WAF (web application firewall)

A WAF (web application firewall) is a filter placed in front of a web application that inspects every HTTP request (URL, parameters, headers, body) and blocks those that match known attacks, such as SQL injection or cross-site scripting.

A traditional network firewall makes decisions based on IP addresses and ports: it doesn't read the content of a web request and therefore lets through everything that arrives on port 443. A WAF works one level up, at the application layer. OWASP defines it as a firewall for HTTP applications that applies a set of rules to each exchange and can operate as a reverse proxy. Its rules mainly target common web attacks such as [SQL injection](https://www.wp-feint.com/glossary/sql-injection/) and cross-site scripting.

## How a WAF works

The WAF examines the requested URL, the parameters, the headers, the cookies and the request body, then applies its rules. Two approaches coexist:

- **The negative model** (blocklist): it recognizes known attacks, for example a parameter that looks like SQL or a script tag. Easy to deploy, but a new variant can slip through.
- **The positive model** (allowlist): it describes what a parameter is allowed to contain and refuses everything else. More robust, but slower to write and maintain.

A WAF also enables [virtual patching](https://www.wp-feint.com/glossary/virtual-patching/): a targeted rule blocks the exploitation of a known plugin vulnerability until the plugin is updated. OWASP stresses that the flaw isn't removed by this, and the real fix is still needed.

*Video: “What is a Web Application Firewall (WAF)?” (F5 DevCentral Community)*

## Where to put a WAF

![Path of a request to WordPress with three WAF locations: first a cloud WAF acting as a reverse proxy, then a web server WAF such as ModSecurity with the OWASP Core Rule Set, then a firewall plugin inside WordPress, before the WordPress code](https://www.wp-feint.com/media/2026/10/waf-emplacements-en.webp)

- **In the cloud**: a service placed in front of the site, such as Cloudflare or Sucuri, filters traffic before it reaches your server and absorbs part of the attack waves, even a [DDoS attack](https://www.wp-feint.com/glossary/ddos-attack/). The server's real IP address must stay unknown, though, otherwise the attacker targets it directly.
- **On the web server**: ModSecurity, combined with the OWASP Core Rule Set, plugs into Apache or Nginx. The WordPress documentation mentions it as a widely used open source option. On shared hosting, it is often the host that turns it on and chooses the rules.
- **Inside WordPress**: a firewall plugin knows the users, roles and installed plugins, but it runs in PHP, so after the server has already started working.

Our comparison of firewalls for WordPress covers the strengths and blind spots of Wordfence, Cloudflare, ModSecurity and Patchstack.

## The limits of a WAF

- It doesn't fix any code: a logic flaw, such as a missing permission check, looks like a normal request.
- It produces false positives: saving a post that contains code, or certain plugin settings, can get blocked.
- It needs maintenance: OWASP points out that tailoring it to an application takes effort, to be repeated whenever the application changes.
- It doesn't replace updates, unique passwords or two-factor authentication.

## WP Feint and firewalls

WP Feint is not a WAF: it doesn't inspect request content to block attacks. It reduces the visible attack surface (WordPress hidden, login page moved, XML-RPC blocked) and works alongside a firewall. Our setup guides with [Wordfence](https://www.wp-feint.com/wordfence-and-wp-feint/) and with [Sucuri's cloud firewall](https://www.wp-feint.com/sucuri-and-wp-feint/) show how to split the roles, and [Cloudflare support](https://www.wp-feint.com/features/cloudflare/) lets the Pro version see visitors' real IP addresses behind the proxy.

## Common mistakes

- Putting off an update because “there's a firewall.”
- Turning off the whole WAF after a false positive, instead of adding a targeted exclusion.
- Stacking several application firewalls inside WordPress: they get in each other's way without adding protection.

## Related terms

- [Virtual patching](https://www.wp-feint.com/glossary/virtual-patching/)
- [SQL injection](https://www.wp-feint.com/glossary/sql-injection/)
- [XSS (cross-site scripting)](https://www.wp-feint.com/glossary/xss/)
- [DDoS attack](https://www.wp-feint.com/glossary/ddos-attack/)
- [CDN](https://www.wp-feint.com/glossary/cdn/)


## Sources

- [OWASP : Web Application Firewall](https://owasp.org/www-community/Web_Application_Firewall)
- [OWASP Cheat Sheet Series : Virtual Patching](https://cheatsheetseries.owasp.org/cheatsheets/Virtual_Patching_Cheat_Sheet.html)
- [WordPress Advanced Administration : Hardening WordPress](https://developer.wordpress.org/advanced-administration/security/hardening/)
