What a Web Application Firewall (WAF) blocks—and what it misses
A WAF inspects HTTP traffic to detect or block common attack patterns. It can help reduce SQL injection and similar attacks, but cannot fix authorization or business-logic flaws. Learn how deployment paths, rule scope, false positives, false negatives, narrow exceptions, and rollback affect operations.
What a Web Application Firewall (WAF) blocks—and what it misses
A web application firewall (WAF) inspects HTTP traffic against rules to detect or block suspicious requests. It can reduce common attack patterns such as SQL injection and some cross-site scripting attempts, but it cannot repair an authorization flaw that exposes another user’s data or an error in business logic. Use it as one defense layer alongside application fixes, access controls, logging, and monitoring.
What happens in the request path?
A WAF can sit in the request path as a reverse proxy, CDN, appliance, or web-server module. It compares methods, hosts, paths, headers, cookies, query strings, and parseable request bodies with rules, then may allow, log, block, or challenge traffic. Some products inspect responses too.
A rule may recognize a string pattern often associated with SQL injection. That does not mean the WAF understands whether the application’s database can actually be exploited. Rules observe HTTP representations; they usually lack full knowledge of data flow, user permissions, or business context. OWASP CRS is a collection of generic detection rules for ModSecurity and compatible engines. Cloudflare managed rules are one product example that can aggregate rule-match scores.
Where can it run?
A cloud WAF can inspect traffic routed through a provider’s proxy. A self-managed WAF can run as a reverse proxy or inside a web server. In either case, confirm that user traffic passes through it and that no direct route to the origin server bypasses the WAF.
| Deployment | Operational benefit | Check |
|---|---|---|
| CDN or cloud proxy | Apply rules at an external edge in front of multiple hosts | DNS proxy coverage, direct origin access, provider dependency, logging and data terms |
| Reverse proxy or appliance | Control routing and rules before the application | Capacity, high availability, patching, certificates, configuration workload |
| Web-server module | Run rules close to the server handling requests | Consistent rollout, application load, and outage impact |
These are general trade-offs, not guarantees for every product. Compare protected protocols and assets, body-inspection limits, rule updates and exceptions, fail-open or fail-closed behavior, log access, privacy, performance, cost, and your team’s ability to operate the service.
What can a WAF catch—and miss?
Generic rules can filter common input patterns and may reduce exposure temporarily while a patch is prepared. They can miss new or obfuscated attacks, requests outside inspection, and traffic for which rules are disabled. If the origin server is reachable directly from the internet, requests that skip the front WAF may bypass its protection.
A generic WAF rule cannot reliably decide whether a user may view a particular order or whether changing a price is valid at a point in a workflow. Fix and verify access-control flaws, weak session handling, invalid state transitions, and excessive privileges in the application itself. OWASP CRS also explains that generic pattern detection does not replace fixing application-specific logic flaws.
Manage false positives and false negatives
A false positive is a legitimate request blocked as malicious; a false negative is malicious traffic that passes. For example, an editor saving HTML or SQL examples for security training may trigger a rule and have a legitimate save blocked. Attacks may pass when detection is disabled, a body is outside inspection, or a request reaches the origin directly.
**Map assets and paths.** List domains, APIs, upload routes, origin servers, proxies, and exception paths. Confirm which requests pass through the WAF.
**Observe before blocking.** If supported, review events in log or monitoring mode. Include ordinary inputs, peak load, administration, and uploads in representative workflows.
**Investigate the event.** Review rule ID, matched variable, URI, request type, and time. If logs may contain sensitive bodies, check access controls, masking, retention, and provider terms.
**Use the narrowest exception.** For a confirmed false positive, consider an exception for a specific path, method, parameter, or rule rather than disabling a full ruleset. Test that it does not also allow attacks.
**Enable blocking gradually.** Record baseline behavior and start with a limited service or traffic slice. Review block rates, error rates, support reports, WAF events, and origin logs together.
**Prepare rollback.** Version rule changes and record owners, approvals, and rollback steps. If normal requests are blocked, revert or narrow only the affected rule or exception, restore service, and validate again.
Product modes differ, so follow current vendor documentation. Cloudflare recommends investigating event and match details for blocked legitimate traffic and, where possible, adjusting the specific rule rather than disabling the full ruleset. OWASP CRS discourages editing base rule files directly because updates may erase changes or create operational errors; use supported exclusion methods.
Example: a content editor request is blocked
Hypothetical example: an administrator tries to save an HTML sample for a security lesson, and the WAF blocks it. Do not immediately disable all XSS detection. Review the event’s rule, route, and parameter, then check whether the application stores and renders the value safely. If this is a legitimate workflow, test an exception limited to that field and route. Verify both normal saves and malicious-input blocking before and after the change. If the application handles input unsafely, fix the code instead of relying on an exception. This is illustrative, not an observation about a real service.
Operational checklist
Does external traffic pass through the WAF, and is direct origin access restricted?
Which ruleset and version are active? Who approved disabled or excluded rules, and why?
Which WAF events and server logs help identify false positives and false negatives?
Could body logging collect personal information, authentication tokens, or sensitive uploads? How are access and retention limited?
Do rule updates have an owner, change record, impact review, and rollback plan?
Are WAF alerts kept separate from the work of fixing application vulnerabilities and reviewing secure design?
A WAF is valuable when traffic paths and rule scope are clear, teams review outcomes for legitimate and malicious traffic, and the underlying application defects are fixed. A WAF event is an investigation lead, not proof that an application is secure.
References
OWASP Developer Guide, [ModSecurity WAF](https://devguide.owasp.org/en/09-operations/03-modsecurity/) — deployment and rule configuration.
OWASP CRS, [Frequently Asked Questions](https://coreruleset.org/faq/) — scope of generic detection and limits for application-specific logic flaws.
OWASP CRS, [False Positives and Tuning](https://coreruleset.org/docs/2-how-crs-works/2-3-false-positives-and-tuning/) — false positives, narrow exclusions, and risks of editing base rules.
Cloudflare, [Troubleshoot managed rules](https://developers.cloudflare.com/waf/managed-rules/troubleshooting/) — product-specific event review, exceptions, and false-negative diagnosis.
Cloudflare, [Managed Rules](https://developers.cloudflare.com/waf/managed-rules/) — managed rules and request-body inspection limits. Limits vary by plan; check current documentation.