I've been conducting a comprehensive evaluation of our web application firewall's efficacy as part of a broader security posture review, and I've encountered a persistent anomaly that I need the community's insight on. Our WAF, a cloud-based solution positioned in front of our customer data portal, is demonstrably allowing through what I classify as textbook SQL injection probe patterns. This is occurring despite having the vendor's pre-configured "SQL Injection" rule set enabled at a medium paranoia level.
My testing methodology is as follows: I use a controlled staging environment that mirrors our production setup. I then run a series of standardized, benign-looking probes designed to trigger common SQLi signatures.
**Observed Allowed Payloads:**
* `admin'--` (classic comment-based termination)
* `1' OR '1'='1` (always-true condition)
* `1' UNION SELECT null--` (union-based probe)
Our logging dashboard confirms these requests are being evaluated by the WAF but are tagged with an "Allow" action. Concurrently, it is correctly blocking noisier, more overt attacks like `' OR 1=1;--` and `EXEC xp_cmdshell`. This suggests the rule set is partially functional, but its sensitivity is misaligned with the threat landscape.
**My diagnostic steps so far:**
* Verified the WAF policy is actively assigned to the relevant hostname and path.
* Confirmed no custom "exclusion" or "allow" rules have been created for these paths or IP ranges.
* Reviewed the specific rule documentation, which claims coverage for these patterns under OWASP Rule IDs 942100-942999.
* Ensured the policy is in "Detection and Prevention" mode, not just "Detection."
My primary hypothesis is a rule ordering or precedence issue, where a broader "allow" rule (perhaps for API traffic or specific user agents) is taking precedence. A secondary hypothesis is that the vendor's "medium" paranoia level intentionally overlooks these simpler probes due to false-positive concerns with legacy web forms, which seems a dangerous default.
Before I engage the vendor's support—a process I find often lacks methodological rigor—I wanted to query the community:
* Has anyone performed a similar side-by-side test and observed granular gaps in default SQLi rule sets?
* Are there specific WAF architectural nuances (e.g., streaming vs. full-buffer inspection, application of rules per argument vs. whole request) that could explain this selective blindness?
* What is your recommended framework for systematically validating WAF rule coverage, beyond trusting vendor benchmarks?
I am particularly interested in the operational intersection of threat intelligence feeds and WAF rule tuning—specifically, how you balance updating rules for maximum coverage against maintaining application stability. Concrete examples of how you've structured your testing and validation pipelines would be invaluable.
This is a classic and frustrating scenario. The discrepancy between blocking `' OR 1=1;--` and allowing `1' OR '1'='1` is a huge clue. It often comes down to how the rule engine is parsing the request.
Many rule sets at medium paranoia are looking for specific, noisy character sequences or a critical mass of SQL keywords. A payload like `1' OR '1'='1` might be getting tokenized in a way that doesn't trip the signature, or the rule might be weighted to ignore strings that appear heavily "data-like" to avoid false positives on legitimate search queries. The single quote is balanced, which can sometimes fool simpler parsing.
You'll need to check two things in your WAF's event details: the specific rule ID that was supposed to fire, and the exact part of the request (URI, ARGS, headers) that was inspected. Often, the issue is that the probe is hitting a parameter the WAF isn't inspecting by default at that paranoia level.
Keep it constructive.
This hits close to home. I was just setting up some basic detection in Grafana and saw similar weirdness with rule matching. Could it be the WAF is looking at each parameter in isolation? `1' OR '1'='1` might be seen as one whole string for the "username" field, so it doesn't match a keyword list. But the `' OR 1=1;--` has that semicolon and double-dash right next to the SQL words, which is a more explicit signature.
Have you checked if the logging shows *which* part of the request the WAF analyzed for those allowed requests? Sometimes it only looks at the URI path and misses the query string or POST body entirely.
Your methodology is sound, but you're hitting a core limitation of signature-based detection. The allowed payloads like `admin'--` and `1' OR '1'='1` often evade medium-paranoia rules because they lack the specific token sequence or keyword density the engine is tuned for. The dash-dash comment must be directly adjacent to a SQL keyword in many rule sets, and a balanced quote pair can look like a valid string literal.
You need to inspect the raw transaction breakdown in your WAF logs. Look for the `matched_data` field or equivalent. It will show you exactly which part of the normalized request string the rule engine evaluated. I've seen cases where the normalization process itself, like URL-decoding parameters multiple times, can obfuscate the payload before pattern matching occurs.
What's the vendor and specific rule set version? The behavior on `1' UNION SELECT null--` is particularly telling. A union probe without a preceding space or with a numeric prefix can slip through if the rule is looking for `UNION SELECT` as a discrete, whitespace-delimited phrase.
The normalization point is interesting. In my last review, I saw a similar issue where URL encoding like `%27` was decoded before the rule check, but double encoding like `%2527` wasn't handled correctly. Could that be part of what's hiding the payload here?
I've also wondered about the "keyword density" you mentioned. If a rule needs, say, two SQL keywords close together, a payload like `admin'--` would just look like a string with some punctuation. Would bumping the paranoia level actually fix that, or just cause more false positives on legitimate data entry?
Thanks for laying out your methodology so clearly. I think your observation about blocking noisier attacks while allowing these textbook probes is the key detail. It strongly suggests the rule set is tuned for explicit SQL keywords and operators, not for the structural patterns of an injection attempt.
A medium paranoia level often makes a trade-off to reduce false positives on legitimate data, which can include strings with single quotes or double dashes. So "admin'--" might be seen as a valid username with punctuation, while "' OR 1=1;--" is unambiguously malicious.
Have you reviewed the vendor's documentation for the specific logic behind their SQLi rule groups? Sometimes the "medium" setting only activates a subset of rules designed for higher confidence attacks, leaving these grey-area probes as a known gap you're meant to address with custom rules or a higher paranoia level.
Stay curious, stay critical.
This is a strong signal your rule set is tuned for keyword density rather than structural patterns. The allowed probes lack consecutive SQL operators that would trip a threshold.
Check if your WAF normalizes input before rule evaluation. A payload like `1' UNION SELECT null--` might be tokenized into `['1', 'UNION', 'SELECT', 'null']`. If the rule requires a minimum of two keywords in proximity, it could still fail if the engine treats `'1'='1` as a string literal.
You might need a custom rule that flags unbalanced quotes followed by a comment sequence, regardless of surrounding keywords.
sub-100ms or bust
You've put your finger on the critical parsing nuance. The tokenization example is exactly right, and it exposes a fundamental gap in many stock rule sets: they treat SQL as a bag of keywords rather than a grammar.
This is why `1' OR '1'='1` can slip through. A simplistic tokenizer might split on whitespace and punctuation, yielding `['1', 'OR', '1=1']`. If the rule is hunting for `OR 1=1` as a contiguous string, it won't match. Even `'1'='1` might be seen as a single tokenized string literal if the parser is naive.
Building a custom rule for unbalanced quotes is a valid workaround, but you'll likely get false positives on legitimate input like `O'Reilly`. A more surgical approach is to write a rule that looks for the specific pattern of a quote, followed by any characters, followed by a comment sequence (`--`, `#`, `/*`). This targets the injection structure itself.
brianh
Unbalanced quote detection is a minefield for false positives. We tried it last year and ended up flagging every Irish surname in our user database.
Your tokenization example is spot-on, but I'd add that many engines also strip or ignore single-character tokens. So `'1'='1'` might get reduced to nothing, making the threshold logic useless.
show the math
That's a really good point about checking the vendor docs for what "medium" actually enables. I looked at ours after reading this, and you're right, it literally calls out "high-confidence SQL keywords combined with operators" as the trigger. So the `admin'--` type stuff is explicitly lower priority to avoid flagging things like usernames.
It makes sense they'd design it that way, but it feels weird that such basic textbook attacks are considered "grey area". Is the expectation that everyone just cranks it to high paranoia and deals with the false positives?
Ask me in a year
Oh that's a really interesting example with the `admin'--`. I was setting up basic WAF rules for my blog last week and ran into something similar. It felt weird that such a famous example from tutorials would get through on a medium setting.
So is the takeaway that "medium" is basically tuned for minimal false positives, even if it means missing classic probes? That seems like a big gap if you're starting out and think you're covered. Should we all just start on "high" and tune from there, even with the extra noise?
Yep, that's exactly the trade-off. It feels wrong because we learn these as classic attacks, but to a signature engine they're just short strings.
Starting on high and tuning down is what I do for internal apps. For a public blog, you could run high for a week, log the blocked legit traffic, and create allow-list rules for those patterns. It's more upfront work but you get the coverage without ongoing noise.
Automate the boring stuff.
That approach of starting high and logging the legitimate blocks is solid for a controlled rollout. The one caveat I've run into is that the initial noise can be overwhelming if you have a lot of user-generated content, like comments or forum posts. You really need a good process to sift through those logs efficiently.
It also assumes you have the bandwidth to analyze and create those allow-list rules. On a smaller team, that upfront work can be a real barrier, which sometimes pushes people back to a medium setting just to keep things manageable.
—HR
You've identified the core problem. Your "medium" setting is working exactly as designed, which is the frustrating part. These classic probes are low-signal noise to a keyword-density engine.
The vendor's logic likely sees `admin'--` as one short string and a comment operator, not a full attack pattern. It's waiting for the higher-confidence combo, like the `OR 1=1;--` you saw blocked.
You have two real paths forward, neither ideal. One is to bump the paranoia level to high and accept the flood of false positives you'll need to manually tune out. The other is to write a custom rule targeting the specific structural anomaly, like a quote immediately followed by a comment sequence. But as others noted, that's a minefield for legitimate data.
The dirty secret is that a lot of compliance checkbox exercises stop at "medium" and call it a day. Your testing just proved why that's insufficient.
Trust but verify – and audit
The payloads you've listed getting through are a perfect illustration of the parsing gap. They likely fail the "keyword density" check because they're syntactically minimal. `admin'--` is often just a string token plus a comment token. A rule looking for `OR 1=1` as a contiguous string won't catch `1' OR '1'='1` after tokenization splits on the quotes.
This is why I always recommend instrumenting the *application* layer to log the raw, pre-parsed input strings for any request that passes the WAF but results in a database error, even a 500. You'd be surprised how often the actual attack string differs from what the WAF's normalizer finally evaluates.
Extract, transform, trust