Why semantic scanning
An attack can change its spelling without changing what it does. Semantic scanning looks at the relationships inside input to find evidence that a keyword alone cannot explain.
- Input being analysed
The idea
Think of a sentence. Recognizing individual words is useful; understanding how they fit together tells you much more. A scanner can apply a similar principle to a computer language: identify its operators, expressions and potentially dangerous combinations.
The word select in a customer message is not enough to establish SQL injection. A condition that changes the logic of a query is stronger evidence. Even then, the WAF cannot know whether the backend will execute that input or safely store it as text.
- Evidence found
- Normal filter
Explore an example Illustrative
Input
SELECT name FROM products WHERE id = 7 OR 1 = 1 A query with an always-true condition
The OR connects a normal filter to a constant comparison. If executed as SQL, the condition can broaden the result set.
The relationship between operators and values explains the risk.These preset explanations run only in your browser. They do not submit traffic, execute SQL, or predict an actual WAF verdict. A simplistic keyword filter is the comparison here; production signature-based tools are more sophisticated.
Inside the scanner
"Semantic" is a family of analysis techniques. WAFio uses deterministic, language-specific engines. It does not send requests to an LLM to guess a user's intent, and it does not use a complete AST parser for every category.
A conceptual analysis path
- Extract relevant input. Separate URI, query values and body fields. Preserve where a finding came from instead of treating the whole request as one language.
- Normalize supported forms. Decode supported representations so encoded punctuation can be inspected. Normalization is bounded and must be tested against backend behavior.
- Analyze language structure. Use the relevant parser, tokenizer or structural checks. SQL combines AST evidence with heuristics and regular-expression safety nets for some fragments and dialect cases.
- Collect evidence and apply policy. Weigh the evidence of risky constructs; twelve engines compare it with their sensitivity level. Carry the reason, the affected field and the strength of the detection, strong or weak, into the decision of the WAF agent.
- Allowed or logged
- Blocked
- What an AST adds
- A syntax tree connects operators to their operands. It can expose a constant comparison, a query union or nested expressions, rather than treating each token as unrelated text.
- What an AST cannot add
- It cannot reveal the backend's final query, authorization checks or parameter binding. An unsupported dialect or an incomplete fragment may not parse as expected.
The context boundary
- Visible to the WAF
- Request input: fields, syntax, encodings and configured policies.
- Inside your application
- Actual execution: query construction, permissions, business logic and data access.
Structural detection is a protective layer. Parameterized queries, output encoding, validation and access control still belong in the application.
Semantic scanning and keyword matching
Semantic analysis can be better than a simple keyword rule when the risk depends on how tokens relate. It can recognize supported attack structures across some surface variations and produce more specific explanations. Those are architectural advantages, not a universal accuracy or performance guarantee.
Signature matching is not just a keyword blacklist.
Signature-based WAFs use text transformations, rule conditions and anomaly scoring, and some call libinjection-style operators for SQLi and XSS. Structural techniques and signature systems overlap; neither label alone tells you which system will detect an attack.
- Request blocked
- Request forwarded
The picture compares one input with a simplistic keyword rule. It illustrates the idea and is not a measured result.
| Dimension | WAFio semantic scanning | Keyword or signature matching |
|---|---|---|
| Primary question | What language structure or risky operation is present? | Which known patterns or keywords appear in this request? |
| Detection methods | Language-specific parsers, tokenizers, structural checks, heuristics and pattern fallbacks. | Pattern lists, regular expressions and keyword conditions, often with text transformations applied before matching. |
| Strong use cases | Recognizing supported injection structures despite some changes in spelling or whitespace. | Broad coverage of known attack strings, protocol checks and a long-established tuning practice. |
| False positives | Structure can distinguish some harmless keyword use. Legitimate SQL, HTML or templates can still match. | Exclusions and per-pattern tuning help control noise. Complex legitimate input can still match. |
| Blind spots | Unsupported syntax, incomplete fragments, parser differences and application context. | Coverage and transformation gaps, unfamiliar attack forms and application context. |
| Operational cost | Parser work depends on payload complexity and which engines run. Measure realistic traffic. | Cost depends on the number of patterns, operators, transformations and traffic. Measure the same workload. |
| Maintenance | Parsers, normalization, evidence weights and regression cases need updates. | Patterns, exclusions and regression cases need updates as attacks and applications change. |
| Best deployment | A structural signal within a layered security policy. | Complementary coverage within a layered security policy. |
Scoring systems differ between products. Do not compare the numeric scores of one tool with another's directly.
The WAFio pipeline
WAFio does not simply run every detector and add every number. The request path has early decisions, and each engine can be switched off or set to Log only. This list focuses on semantic processing after earlier request-policy checks.
Simplified request flow, current implementation
- Request and earlier policy checks. Size, access and traffic controls can decide earlier.
- Semantic analysis. The engines that are on inspect the supported request input. Twelve engines weigh evidence against their own sensitivity level.
- Strength and policy. A strong detection blocks; a weak one is logged. An engine set to Log only records what it would have blocked and lets the request through.
- Verdict. Allow, log or block.
- Allowed or logged
- Blocked
A clean result means no configured semantic evidence was found. It does not prove a request is safe. Path exceptions, disabled engines and other project policies also affect which steps run. Review the deployed configuration when investigating a verdict.
The list omits error handling and unrelated policy branches for readability.
Engine coverage
WAFio has 20 engines, grouped here by job. Different attack families need different evidence. "Semantic" does not mean every engine has the same parser, the same certainty or the same blocking behavior. The detection engine reference lists every analyzer with its techniques.
- Queries & expressionsSQL, NoSQL, LDAP, SSTI
- Look for query operators, filter manipulation and template expressions. SQL uses AST evidence alongside heuristic and pattern checks.
- Browser & executionXSS, CMD, PHP, Python, Java
- Inspect markup contexts, shell syntax and language-specific execution indicators. Each engine has its own analysis techniques.
- Resources & objectsLFI, SSRF, XXE, Deserialization, Prototype Pollution
- Look for traversal, suspicious fetch targets, XML entities and dangerous object manipulation. A match is evidence, not proof of backend execution.
- Protocols & tokensHeader Injection, GraphQL, JWT
- Check protocol-level abuse: CRLF in header values, GraphQL introspection and oversized batches, and unsigned or key-traversing JWTs. JWT, header injection and GraphQL findings can block. GraphQL introspection is only logged; a batch over the limit is blocked.
- Visibility signalsOpen Redirect, Prompt Injection, Anomaly
- Surface suspicious redirects, prompt patterns and unusual input. Open redirect findings are only logged. Prompt injection is logged, and blocked on a chat or LLM path. Anomaly is logged, except the User-Agent of a scanner, which is blocked.
Malicious upload detection is a separate control.
Uploaded binary files are not treated as source code by the semantic engines. Malicious Uploads Detection compares complete file hashes against available signatures, with exact hash verification. It does not unpack every archive or detect every modified malware sample.
Strengths and limits
Where structure helps
- Fewer simplistic matches. A word can be assessed in its surrounding syntax rather than blocked in isolation.
- Variation tolerance. Supported encodings, spacing and expressions may still map to recognizable operations.
- Clearer investigations. Field-level reasons and structural evidence help explain a finding.
- Targeted policies. Category-specific tuning can match an application's expected input.
What still needs work
- Parsing has limits. Fragments, malformed syntax and unsupported dialects can evade or confuse analysis.
- Context is incomplete. Teaching tools and code editors legitimately accept suspicious syntax.
- Resources are finite. Large or complex payloads require bounded processing and measured limits.
- Some flaws look ordinary. Broken authorization and business-logic abuse may contain no injection syntax at all.
Keyword and signature matching bring broad, familiar detection knowledge and an established tuning model. Their trade-offs include application-specific exclusions, potential noise from stricter settings and ongoing pattern maintenance. Semantic scanning has the trade-offs listed above, and it also needs its configuration, logs and regression tests managed carefully.
Evaluate and deploy
"Better" should mean more relevant attacks caught, less legitimate traffic disrupted, and acceptable resource use on your application. There is no defensible zero-false-positive promise or universal speed claim without a defined dataset and test conditions.
A repeatable evaluation cycle
- Build a corpus. Representative legitimate requests and controlled attack cases.
- Compare settings. Each engine setting and sensitivity level you plan to use, on the same traffic.
- Measure. False positives, missed attacks, p95 and p99 latency, CPU and memory.
- Tune and repeat. Narrow changes, replay regression cases, keep a rollback.
- Next step
- Repeat
Rollout
- Begin in a controlled environment. Include login, search, JSON APIs, rich text, non-English text and uploads. Label expected behavior independently of the WAF.
- Inspect the evidence. Record the field, category, reason, strength, match detail and effective policy. Do not treat a blocked request as automatic proof of an attack.
- Tune narrowly. Scope exceptions to the necessary route or input and retain other protections. A global bypass can hide unrelated attacks.
- Roll out gradually. Review legitimate traffic impact and application errors, then expand enforcement. Re-test when the app, parser, rules or policies change.
Compare like with like.
Keep hardware, concurrency, payload sizes and configured coverage consistent. Record versions, dataset composition and warm-up conditions. A faster mode that skipped a detector is not evidence that the same coverage became faster.
Glossary
Semantic analysis
Examining structure and relationships in input to identify potentially dangerous operations. In WAFio this means deterministic analyzers, not an LLM deciding what a user intended.
Token
A meaningful piece of a language: a name, number, string, operator or keyword. A tokenizer splits input into these pieces.
AST
Abstract syntax tree: a structured representation of a parsed expression or program. It exposes relationships such as an OR expression containing two comparisons.
Normalization
Converting supported representations, such as URL encoding, into a form that a detector can inspect. Too much or too little decoding can differ from the backend.
False positive / false negative
A false positive flags legitimate traffic. A false negative misses an attack. Reducing one can increase the other; evaluate both.
WAFio-specific behavior was checked against the current implementation. Illustrations explain concepts; they are not measured benchmark results. Reviewed November 2026, for version 2.0.0.