Skip to content
Back to Blog
·9 min read·technology

Web Application Firewall (WAF) Explained: OWASP Top 10 Guide

How a WAF blocks OWASP Top 10 attacks like SQLi and XSS, signature vs allowlist models, rate limiting, tuning false positives, and why VAPT still matters.

BR

Bachao.AI Research Team

Cybersecurity Research

Scan Your Attack Surface

Security exposure this creates

Unpatched vulnerabilities in your tech stack are the #1 entry point for breaches targeting Indian businesses. Here's what to watch.

A Web Application Firewall (WAF) is a security control placed in front of a web application that inspects incoming HTTP/HTTPS traffic, compares it against rules or behavioral baselines, and blocks requests that look like attacks — SQL injection, cross-site scripting, path traversal, and other patterns mapped to the OWASP Top 10 — before they reach the application code. It works by evaluating every request's headers, parameters, cookies, and body against a ruleset (negative/signature-based, positive/allowlist-based, or both) and either allows, blocks, or challenges the traffic in real time. A WAF is a runtime shield, not a substitute for fixing vulnerable code or running periodic VAPT.

For Indian teams shipping customer-facing web apps — fintech portals, e-commerce checkouts, healthcare intake forms, SaaS dashboards — a WAF is one of the fastest controls to deploy that meaningfully reduces exposure to automated attack traffic, which makes up the overwhelming majority of what hits any internet-facing endpoint.

How a WAF Actually Works

A WAF sits logically between the client and the application — either as a reverse proxy, a CDN-edge module, a cloud-native service (e.g., in front of a load balancer), or an inline appliance. Every request passes through it before reaching the origin server.

The inspection pipeline typically does four things:

  1. Parses the request — method, URL path, query string, headers, cookies, and body (including JSON, form-encoded, and multipart payloads).
  2. Normalizes the input — decodes URL encoding, Unicode tricks, and other obfuscation attackers use to slip malicious payloads past naive filters.
  3. Evaluates rules — checks the normalized request against signature patterns, anomaly scores, rate thresholds, and reputation data (known bad IPs, Tor exit nodes, data-center ASNs commonly used by scanners).
  4. Takes an action — allow, block, log-only (monitor mode), challenge (CAPTCHA/JS challenge for suspected bots), or rate-limit.
graph TD A[Client request] --> B[WAF inspects request] B --> C{Matches attack rule} C -->|Yes| D[Block request] C -->|No| E[Forward to application] E --> F[Application response] style A fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style B fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style C fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style D fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 style E fill:#1e3d2f,stroke:#10B981,color:#e2e8f0 style F fill:#1e3d2f,stroke:#10B981,color:#e2e8f0
ℹ️
INFO
A WAF operates at Layer 7 (application layer), unlike a network firewall, which filters by IP/port at Layers 3–4. This is why a WAF can distinguish a legitimate login POST from a SQL-injection payload disguised as a login POST — a network firewall has no visibility into that distinction.

Mapping WAF Rules to the OWASP Top 10

The OWASP Top 10 (2021 edition, the current published list) is the industry-reference categorization of the most critical web application security risks: A01 Broken Access Control, A02 Cryptographic Failures, A03 Injection (which now includes Cross-Site Scripting, merged into this category in the 2021 revision), A04 Insecure Design, A05 Security Misconfiguration, A06 Vulnerable and Outdated Components, A07 Identification and Authentication Failures, A08 Software and Data Integrity Failures, A09 Security Logging and Monitoring Failures, and A10 Server-Side Request Forgery (SSRF).

A WAF is directly effective against a subset of these — the ones that manifest as a malicious pattern in an inbound request:

    1. Injection (A03) — SQL injection, command injection, and LDAP injection payloads contain recognizable syntax (' OR '1'='1, UNION SELECT, shell metacharacters). Signature and anomaly-scoring rules catch a large share of unsophisticated injection attempts at the request layer.
    2. Cross-Site Scripting — payloads like <script>, onerror=, or encoded variants are matched against XSS signature libraries and blocked before they reach a vulnerable output context.
    3. Security Misconfiguration (A05) — a WAF can block requests probing for exposed admin paths, default credentials pages, or common misconfiguration fingerprints, and can enforce security headers on responses.
    4. SSRF (A10) — rules can restrict outbound-triggering parameters (URLs passed in request fields) from targeting internal IP ranges or cloud metadata endpoints.
    5. Vulnerable/Outdated Components (A06) — virtual patching: a WAF rule can block exploitation attempts for a known CVE in a specific library/CMS while the underlying patch is scheduled, buying time without code changes.
A WAF is largely ineffective — or only partially effective — against categories that are architectural or logic flaws rather than malicious-looking requests: Broken Access Control (A01) (a request to view another user's order ID often looks syntactically identical to a legitimate one), Insecure Design (A04), and Authentication Failures (A07) beyond basic brute-force rate limiting. These require secure coding and design review, not request inspection.
🛡️
SECURITY
Treat the OWASP Top 10 as your baseline threat model regardless of which controls you deploy. A WAF, secure coding practices, and periodic VAPT each cover different, overlapping slices of it — none of the three alone covers the full list.

Negative Model (Signatures/Blocklist) vs Positive Model (Allowlist)

WAFs operate on one of two core philosophies, and most production deployments blend both.

AspectNegative model (signatures/blocklist)Positive model (allowlist)
LogicBlock requests matching known-bad patternsAllow only requests matching known-good patterns; block everything else
Setup effortLow — ships with managed rulesets out of the boxHigh — requires defining valid inputs per endpoint/parameter
False positivesLower initially, rises as attackers evade signaturesHigher initially until the allowlist is fully tuned
False negativesHigher — zero-day and obfuscated payloads can slip throughLower — anything not explicitly permitted is rejected by default
MaintenanceVendor/managed-ruleset updates handle most of itOngoing — every new feature/field needs an allowlist update
Best fitBroad, fast-to-deploy protection across diverse appsHigh-value, stable endpoints (payment forms, auth, admin APIs)
Most managed WAF services (cloud-native and CDN-based) default to a negative-model managed ruleset — a continuously updated library of signatures mapped to OWASP categories and known CVEs — because it deploys in minutes and needs no app-specific tuning. A positive-model allowlist gives stronger protection but demands real engineering investment per endpoint, so it's typically reserved for the highest-value routes: login, payment, and admin surfaces.
💡
TIP
Start with a managed negative-model ruleset in monitor/log-only mode, review the logs for a few days to see what would have been blocked, then flip to blocking mode. Layer a positive-model allowlist on top for your two or three most sensitive endpoints once the app is stable.

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

Rate Limiting and Bot Mitigation

A large share of malicious traffic hitting any public web app isn't a crafted exploit payload at all — it's automated: credential-stuffing bots, content scrapers, vulnerability scanners, and API abuse scripts. WAFs handle this class through:

    1. Rate limiting — capping requests per IP/session/API key within a time window, tuned per endpoint (login and OTP endpoints need much tighter limits than a public product listing page).
    2. Bot detection — fingerprinting (TCP/TLS/JA3 signatures, header ordering, JS-execution challenges) to distinguish browsers from scripted clients, and reputation feeds flagging known scanner/bot IP ranges and data-center ASNs.
    3. CAPTCHA/JS challenges — inserted selectively when a request looks automated but isn't outright malicious, rather than blocking outright and risking a false positive on a real user.
pie title Typical Attack Categories Blocked at the WAF Layer "SQL injection and XSS" : 30 "Bots and scanners" : 28 "Credential stuffing/brute force" : 18 "Known-CVE exploitation" : 14 "Other malformed requests" : 10

(Qualitative distribution illustrating typical WAF-layer traffic categories; actual proportions vary by application, industry, and exposure — treat this as directional, not a benchmarked statistic.)

False Positives and Tuning

The single biggest reason WAFs get disabled or bypassed in production is unmanaged false positives — legitimate user traffic blocked because it superficially resembles an attack pattern (a customer support message containing the word "SELECT," a rich-text field with angle brackets, a legitimate API payload with nested JSON that trips an anomaly threshold).

A disciplined tuning workflow looks like this:

  1. Deploy new rules or rulesets in monitor/log-only mode first — never blocking mode on day one.
  2. Review logged "would-block" events against real production traffic for at least a few days to a week, covering a full business cycle.
  3. Create targeted exceptions for legitimate patterns (specific parameters, content types, or user agents) rather than disabling entire rule categories.
  4. Move to blocking mode incrementally, starting with the highest-confidence rules (known exploit signatures) before broader anomaly-scoring rules.
  5. Re-tune whenever the application changes — a new form field, a new API version, or a new third-party integration can all trigger fresh false positives.
⚠️
WARNING
An untuned WAF in aggressive blocking mode is a common cause of "why did checkout stop working" incidents. Teams that skip the monitor-mode phase to "turn security on faster" frequently end up disabling the WAF entirely after a production outage — which is worse than a well-tuned WAF, because it leaves zero coverage instead of partial coverage.
94%Share of tested web applications with at least one broken access control finding (OWASP Top 10 2021 data set)
3rdInjection's rank in the OWASP Top 10 2021, down from 1st in the 2017 edition (OWASP)

Why a WAF Complements — Not Replaces — VAPT and Secure Coding

A WAF blocks attack traffic at the network edge based on pattern-matching and heuristics. It does not fix the underlying vulnerability, and it cannot reason about business logic. Three gaps a WAF structurally cannot close on its own:

    1. Logic flaws. A broken access control bug — where an authenticated user can change an ID in a URL and view someone else's data — produces a syntactically normal request. No signature or anomaly score flags it, because nothing about the request looks malicious.
    2. Zero-day and novel payloads. Signature-based rules only catch what they've been written to recognize. A genuinely new exploitation technique can pass through until the ruleset is updated.
    3. Compliance and assurance requirements. Regulatory and customer-security expectations in India increasingly call for documented, periodic VAPT — a WAF's traffic logs are not a substitute for a structured assessment that maps findings to the codebase and verifies remediation.
The two controls are complementary by design: VAPT (manual or automated) finds and helps fix the actual vulnerabilities in code and configuration; the WAF reduces the window of exposure and blocks the noisy, automated majority of attack traffic while those fixes are scheduled and shipped. Continuous automated scanning between formal audit cycles — our approach — helps surface exactly the kind of logic and configuration issues a WAF's request-level inspection cannot see, so remediation work is prioritized against real findings rather than WAF log noise. Bachao.AI is built by Dhisattva AI Pvt Ltd, a DPIIT Recognized Startup.
🎯Key Takeaway
A WAF is a fast, high-value control for blocking the automated majority of web attack traffic — but it inspects requests, not code. Pair it with secure coding practices for access-control and business-logic flaws, and with periodic VAPT to find and verify fixes for what a WAF cannot see, rather than treating the WAF as a complete security program on its own.

Practical Rollout Checklist for Indian Teams

StepAction
1Deploy a managed negative-model ruleset in monitor mode first
2Review logs for a full business cycle before enabling blocking
3Set tighter rate limits on login, OTP, and payment endpoints
4Add a positive-model allowlist for the highest-value endpoints
5Enable bot/challenge mode for suspected non-browser traffic
6Re-tune after every significant application or API change
7Run periodic VAPT independent of WAF coverage, and track remediation
8Review WAF logs and VAPT findings together during each audit cycle

Frequently Asked Questions

Frequently Asked Questions

Does a WAF stop all OWASP Top 10 attacks?
No. A WAF is effective against request-pattern-based risks like injection, XSS, and known-CVE exploitation, but it cannot reliably catch logic-based risks like broken access control or insecure design, since those requests often look syntactically normal.
What's the difference between a negative and positive security model in a WAF?
A negative (signature/blocklist) model blocks requests matching known-bad patterns and is fast to deploy with low tuning effort. A positive (allowlist) model allows only explicitly defined valid input and blocks everything else, giving stronger protection but requiring per-endpoint configuration effort.
Can a WAF replace penetration testing?
No. A WAF filters traffic at runtime based on patterns; it does not find or fix vulnerabilities in code, and cannot detect business-logic flaws. VAPT identifies the actual weaknesses; the WAF reduces exposure while those weaknesses are remediated.
Why did my WAF block legitimate customer traffic?
This is a false positive, usually from an untuned signature or anomaly rule matching benign input that superficially resembles an attack pattern. Deploying new rules in monitor mode first and reviewing logs before enabling blocking substantially reduces this risk.
Is a cloud/CDN-based WAF enough for a small Indian business, or do I need a dedicated appliance?
Most Indian SMBs and mid-size businesses get adequate baseline coverage from a cloud-native or CDN-edge WAF with a managed ruleset, which deploys quickly without infrastructure changes. Dedicated appliances are typically only justified for large enterprises with complex, high-value, high-traffic environments.
How does a WAF fit with DPDP Act compliance?
A WAF is one technical control among several that supports the DPDP Act's expectation of reasonable security safeguards for personal data, alongside encryption, access controls, and periodic security testing — it is not a standalone compliance measure. Read more on our blog or see our DPDP compliance coverage.

Sources: OWASP Top 10:2021 (owasp.org), NIST SP 800-53 (application security controls) (nist.gov), CERT-In guidelines on web application security (cert-in.org.in).

Want to see which OWASP Top 10 risks your own application is exposed to, independent of your WAF configuration? Book a free VAPT scan.

BR

Bachao.AI Research Team

Cybersecurity Research

AI-powered security research and threat intelligence from the Bachao.AI team. Covering the latest vulnerabilities, CVEs, and cybersecurity developments affecting Indian businesses.

Get cybersecurity insights for Indian SMBs

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Find out if you're exposed to this class of threat

Free automated scan — risk score in under 2 hours. No credit card required.

Scan Your Attack Surface
Find your vulnerabilitiesStart free scan →