Glossary

What is a Web Application Firewall (WAF)?

May 20, 2026

A Web Application Firewall (WAF) is a security layer that inspects every incoming HTTP and HTTPS request to a website and blocks malicious traffic before it reaches the application. Unlike a classic network firewall that filters by IP address and port, a WAF understands the HTTP protocol and looks at URLs, query parameters, request bodies, cookies, headers and user agents. For WordPress, a WAF blocks SQL injection, cross site scripting (XSS), local file inclusion, brute force login attempts, comment spam, vulnerability scanners and known exploit patterns for plugins and themes. WAFs follow the OWASP Top 10 threat categories and are recognized as a PCI DSS requirement (Requirement 6.4.2 in PCI DSS v4.0, mandatory since March 2025) for any site that processes credit card data.

How does a Web Application Firewall work?

A WAF inspects HTTP traffic against a ruleset. Each rule looks for a specific pattern, for example a request body containing UNION SELECT (SQL injection), a URL with ../../etc/passwd (path traversal) or a login form hit more than 5 times per minute from the same IP (brute force). When a rule matches, the WAF can block the request with HTTP 403, challenge the visitor with a CAPTCHA or JavaScript check, or only log the match for review. Most WAFs combine signature based detection (known attack patterns) with anomaly based detection (statistical deviations from normal traffic) and increasingly machine learning models trained on billions of requests.

What are the main types of Web Application Firewall?

  • Cloud WAF (DNS based): traffic is routed through the provider DNS before reaching your origin server. Examples: Cloudflare, Sucuri, Akamai, AWS CloudFront with AWS WAF, Imperva. Fastest to deploy, also gives DDoS protection and a CDN, requires changing your nameservers.
  • Reverse proxy WAF: a server (often nginx with ModSecurity, or HAProxy) in front of your origin filters requests. Good for self hosted control, requires more setup.
  • Endpoint WAF (application level): a plugin like Wordfence or All In One WP Security runs inside WordPress as PHP code. Easy to install, but the malicious request has already reached PHP, so it costs server resources. Cannot stop a DDoS.
  • Network WAF (hardware): a dedicated appliance like F5 BIG-IP ASM, Fortinet FortiWeb, Barracuda WAF. Used in enterprise data centers, rarely relevant for WordPress.

Which threats does a WAF block?

The OWASP Top 10 (latest version 2021, with 2025 update in draft) defines the categories every WAF must cover:

  1. A01 Broken Access Control: requests trying to access another user data via predictable IDs.
  2. A02 Cryptographic Failures: not directly WAF but mostly TLS configuration.
  3. A03 Injection: SQL injection, NoSQL injection, command injection, LDAP injection.
  4. A04 Insecure Design.
  5. A05 Security Misconfiguration: blocks access to wp-config.php.bak, .git/config, .env, xmlrpc.php.
  6. A06 Vulnerable Components: virtual patches for known CVEs in plugins like Elementor (CVE-2023-48777), WPBakery, RevSlider, Yoast and others before the site owner updates.
  7. A07 Identification and Authentication Failures: brute force on /wp-login.php and /xmlrpc.php.
  8. A08 Software and Data Integrity Failures.
  9. A09 Logging and Monitoring Failures.
  10. A10 Server Side Request Forgery (SSRF).

What is virtual patching?

When a critical plugin vulnerability is published (for example, the LiteSpeed Cache privilege escalation CVE-2024-28000 affecting more than 5 million sites in August 2024), the patch in the plugin itself can take days to roll out across every site. A WAF can deploy a virtual patch, a rule that blocks the exploit payload at the edge within minutes of the CVE going public. Wordfence ships these via its Threat Intelligence Feed (Premium feed updated in real time, free feed delayed by 30 days). Cloudflare WAF Managed Rules and Sucuri Firewall do the same.

Popular WAF options for WordPress

SolutionTypeFree tierNotable features
CloudflareCloud / DNSYes (unlimited)CDN, DDoS protection, Bot Fight Mode, free SSL
Sucuri FirewallCloud / DNSNo, from $9.99/moMalware cleanup included, virtual patching
WordfenceEndpoint pluginYesReal time threat feed (Premium), malware scanner
All In One WP SecurityEndpoint pluginYesLogin lockdown, file integrity scan
NinjaFirewallEndpoint, before WP loadsYesRuns before WordPress core boots, very lightweight
AWS WAFCloud (with CloudFront)No, pay per rule and requestManaged rule groups, integration with AWS Shield
Imperva (Incapsula)Cloud / DNSNo, enterpriseEnterprise SLAs, advanced bot management
ModSecurity + OWASP CRSReverse proxy (open source)Yes (self hosted)Open source, fully configurable, requires expertise

What is the OWASP Core Rule Set (CRS)?

OWASP Core Rule Set is the open source ruleset used by ModSecurity and increasingly other WAFs (Cloudflare, AWS WAF, Google Cloud Armor offer CRS based managed rule groups). The latest stable version is CRS 4.0 (released January 2024) and it ships paranoia levels 1 to 4 (higher means stricter and more false positives). Many cloud WAFs run their own proprietary rules on top of CRS.

Cloud WAF or endpoint plugin: which is better?

  • Cloud WAF stops attacks before they reach your server, so it also reduces hosting load and saves bandwidth. Required if you need DDoS protection. Downside: you must trust the provider with all your traffic (TLS termination at their edge).
  • Endpoint plugin sees decrypted traffic and full WordPress context, so it can match logged in user actions and protect REST API endpoints with role awareness. Downside: the request already consumed PHP cycles, and a real DDoS will exhaust your server before the plugin can block.
  • Best practice is to combine them: Cloudflare or Sucuri at the edge plus Wordfence or NinjaFirewall inside WordPress.

How do I enable a WAF for WordPress?

  1. Cloudflare free plan: sign up at cloudflare.com, add your domain, change nameservers at your registrar to the two Cloudflare nameservers shown. Enable Security » WAF » Managed Rules » Cloudflare Managed Ruleset and Bot Fight Mode. Activate SSL/TLS Full (strict).
  2. Sucuri Firewall: sign up, point your DNS A record to the Sucuri proxy IP they provide, install the free Sucuri Security plugin to sync settings.
  3. Wordfence: install the plugin from wp-admin » Plugins » Add New, run the configuration wizard, switch Firewall Status from Learning Mode to Enabled and Protecting after one week.
  4. NinjaFirewall: install plugin, then move the WAF execution before WordPress core via the wizard which patches php.ini auto_prepend_file.

What are the limits of a WAF?

  • A WAF is not a malware scanner. If a site is already infected, the WAF will not clean it.
  • A WAF cannot protect against weak passwords, leaked credentials reused from another breach (credential stuffing) or social engineering.
  • Aggressive rules cause false positives. Editors get blocked when saving long posts with HTML or code blocks. Tune the ruleset for your CMS.
  • Cloud WAFs require visitors to trust the WAF provider with decrypted traffic.
  • A WAF is not a substitute for keeping WordPress core, themes and plugins patched.

WAF and PCI DSS compliance

PCI DSS v4.0 Requirement 6.4.2 (mandatory since 31 March 2025) requires either a WAF or a manual review and code analysis process for all public facing web applications that handle card data. For most WordPress shops running WooCommerce, a WAF is the practical option. Cloudflare, Sucuri, AWS WAF and Imperva all publish PCI DSS Attestation of Compliance documents.

How does InspectWP help with WAF detection?

InspectWP analyzes the response headers and server signatures of every crawled URL. The report identifies common WAFs by their fingerprints (Server: cloudflare, X-Sucuri-ID, X-WAF, Wordfence specific cookies and challenges) and flags sites that have no WAF in front of WordPress.

Check your WordPress site now

InspectWP analyzes your WordPress site for security issues, SEO problems, GDPR compliance, and performance — for free.

Analyze your site free