Web Application Firewall (WAF)
A web application firewall (WAF) sits in front of a website or web app and filters incoming web traffic, blocking common attacks such as SQL injection, cross-site scripting, malicious bots and some DDoS attacks.
Also called: WAF, web app firewall, cloud WAF
What is a web application firewall?
A regular firewall decides which network connections are allowed. A WAF looks inside web requests themselves, checking the URLs, form fields and headers that browsers send to your website, and blocks ones that look like attacks. It protects against many of the risks in the OWASP Top 10 without changing the application's code.
How does a WAF work?
- Rule sets recognize known attack patterns, such as SQL injection and cross-site scripting payloads.
- Virtual patching blocks exploits for a newly announced flaw before you can update the app.
- Bot management and [rate limiting](/glossary/rate-limiting/) slow down credential stuffing, scraping and brute force attempts.
- Application-layer DDoS protection absorbs floods of requests.
Most small businesses use a cloud WAF from their CDN or hosting provider, such as Cloudflare, AWS or Azure, rather than running their own.
Do you need a WAF?
If you run an online store, customer portal or any app that handles logins or personal data, a WAF is a cheap, effective layer. PCI DSS version 4 requires businesses that handle card data to have an automated solution, such as a WAF, that detects and prevents web-based attacks on public-facing web applications.
Limits
A WAF reduces risk but doesn't fix insecure code, and it can't stop attacks that look like normal use, such as one customer reading another's data through broken access control. Start in monitoring mode, tune the rules, then switch to blocking.
Related terms
Sources
- PCI DSS Document Library (PCI Security Standards Council)
- OWASP Top 10:2025 (OWASP Foundation)
Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.
