WAF bypass: why a request filter cannot be your only defence
A WAF bypass is any route by which a harmful request reaches an application without the firewall judging it correctly, or at all. The routes are mostly plain engineering gaps, not clever tricks, which is why a filter works best as one layer next to a fixed application and a closed origin.
Quick facts
- Definition
- A request reaches the application unjudged or misjudged by the filter
- Typical causes
- Known-form rules, parsing differences, an open origin, unrouted paths
- Parsing differences
- HTTP request smuggling exploits them; see RFC 9112, section 11.2
- Rule sets and false alarms
- Stricter rules catch more and misfire more; see the OWASP CRS documentation
- Lasting remedy
- Fix the code and restrict the origin; the filter buys time in between. Classes of flaw: OWASP Top 10
None of this is an argument against filtering. It is an argument for knowing what the filter is, so that the work around it does not get skipped.
What a bypass is, and is not
The phrase sounds like a break-in. Most of the time it describes something quieter: a request nobody examined. A web application firewall reads HTTP requests that are sent to it and compares them with rules. Anything it was never sent, or reads differently from the application, gets a verdict that does not match what the application does next.
This page stays at the level of concepts. It does not describe how to construct a request that evades a particular rule, and it names no product. The aim is to explain why four gaps exist and what closes each one, so that nobody treats a green filter as proof that the application is safe.
Rules describe known forms
A rule is a description of a shape: this kind of input, in this kind of place, looks like an attack. Shared rule sets such as the OWASP Core Rule Set encode shapes that the community has seen and agreed on. That is their strength, and it is also their limit: a flaw with a form no rule describes yet passes through, and so does a harmful request that looks like ordinary use of a feature.
Tightening the rules is not free. The CRS documentation states the trade plainly: stricter configurations catch more and raise more false alarms on legitimate traffic, and the remedy for those alarms is to write exclusions for specific rules, parameters or paths. Each exclusion is a place where the filter looks less. Bridge WAF takes a different route to the same problem: three modes (off, monitor, block) and an exception with a reason and an expiry when a rule must step aside.
Business-logic flaws are the clearest case. A request that asks for another customer's record, or repeats a legitimate action thousands of times, can be well formed in every byte. The OWASP Top 10 lists such access-control failures among the most common web risks, and no pattern match repairs them. They need a check in the code.
Two readers, one request
A filter and an application are two programs reading the same bytes. If they split the request differently, the filter may judge one request while the application acts on another. This family of problems is usually called differences in parsing, and it needs no malformed rule at all: the rule may be perfect for the request the filter thinks it saw.
Message framing: request smuggling
HTTP has to decide where one message ends and the next begins. RFC 9112, section 11.2 describes request smuggling as a technique that exploits differences in protocol parsing among recipients to hide additional requests. Chains with a proxy in front of an origin are exactly where two recipients can disagree. The standard asks recipients to treat ambiguous framing as an error, and the practical defences are the same: keep proxy and origin software current, and reject malformed messages instead of guessing. The attack class has its own page: request smuggling.
Duplicate input: parameter pollution
Another example is repeated parameters. When a name appears twice, one component may take the first value, another the last, a third both. If the filter judges one reading and the application uses another, the verdict and the behaviour part ways. The page on HTTP parameter pollution covers the class.
The common remedy is not a cleverer rule. It is agreement: one strict, current parser at each hop, ambiguous input refused, and an application that validates what it receives whatever the filter said.
The route around the filter
A filter in front of a site protects only the traffic that goes through it. If the origin server also answers requests that arrive from anywhere, the filter is a door beside an open window. The address of an origin is rarely a secret in any lasting sense, so the safe assumption is that someone will try it directly.
The fix is on the origin side. Configure the server or its network firewall to accept requests only from the filtering layer in front of it, using the source addresses or the authenticated channel that your provider documents, and refuse the rest. The same host should not serve the site on a second public name that skips the filter. Test it from outside your own network: a direct request to the origin should fail.
This is also where reverse proxy setups go wrong: the origin trusts a header that says who the client is, and the header can be written by anyone who reaches the origin. Trust such a header only from the proxy's own addresses.
Coverage gaps
Coverage is a list, and lists go stale. A new subdomain is created for a campaign and never routed through the filter. An older API version stays online beside the new one. A staging copy has the production data and no protection. A path the team exempted for a partner is still exempt a year later.
None of that is a failure of the rules. The filter simply never saw those requests. Keep an inventory of every hostname and path that serves your content, compare it with what the filter actually receives, and treat each exception as temporary. The activity log helps in a modest way: a host that never appears in it either has no traffic or is not covered, and it is worth finding out which.
What to do about it
The order matters, because the first step costs nothing and tells you what the rest should be.
- Start in monitor mode. Matches are recorded and every request is still served, so you learn what the filter sees before it refuses anything. See WAF monitor mode.
- Read the log, and sort the findings. Separate real attack traffic from legitimate requests that matched, using the guidance in false positives. Repeated hits on one path point at a flaw in the code behind it.
- Keep the rules current. Rule sets change as new forms appear; an old rule set describes old shapes. Move to blocking in steps, as in staged rollout.
- Close the origin. Let it accept requests only from the filtering layer, and remove public names that skip it.
- Fix the code. Every finding that reflects a real flaw needs a repair in the application. A virtual patch is a stop-gap with a date on it, not a substitute. OWASP lists vulnerable and outdated components as a category of its own for exactly this reason.
Where a WAF helps and where it does not
A filter sees HTTP requests that were sent to it, one at a time, and judges them by shape. Within that, it does useful work: it records and, when told to, refuses requests matching known forms of attack, it gives you a log to learn from, and it buys time while a repair is written.
It does not see inside the application. It cannot tell whether the person asking for a record owns it, whether a price was tampered with after a check, or what a library does with its input. Those are the concerns that RASP and the application's own checks address from the inside. It also does not see requests that bypass it by design, which is the origin and coverage problem above.
Questions
What is a WAF bypass?
A WAF bypass is any way for a harmful request to reach an application without the firewall judging it correctly, or at all. The causes are usually ordinary: rules that describe only known forms, a filter and an application that read the same request differently, direct access to the origin, or a path that never passed through the filter.
Does a WAF stop every attack?
No. A web application firewall filters requests against rules, so it can reduce exposure to known forms of attack and give time to fix a flaw, but it does not remove the flaw. The application's own validation, access control and patching remain the real defence.
How do I make a WAF harder to get around?
Run it in monitor mode first and read the log, keep rules up to date, make the origin accept requests only from the filter in front of it, check that every hostname and path is routed through the filter, and fix the code behind every finding.
Is a virtual patch a fix?
No. A virtual patch is a filter rule that blocks requests aimed at a known flaw while the code is not yet repaired. It buys time and should carry a date by which the real fix replaces it.
Should the origin be reachable directly?
Not by the public. If the origin answers anyone who connects, the filter in front of it is optional for whoever finds that address. Restrict the origin so it accepts requests only from the filtering layer.