A web application firewall (WAF) is a security device or service placed between a web server and its users that inspects HTTP and HTTPS traffic at the application layer and blocks requests it judges to be attacks. Unlike a traditional network firewall, which filters traffic by IP address and port, a WAF parses the URL, headers, and body of each request to detect web attack patterns such as SQL injection, cross-site scripting (XSS), file inclusion, and buffer overflow payloads.
WAFs combine rule-based signatures with anomaly detection, and they are also used for virtual patching, blocking exploit requests for a newly disclosed vulnerability before the software itself is patched. They can run in a detection mode that only logs attacks or a blocking mode that rejects them outright. They are available as hardware appliances, as software installed on the server (such as ModSecurity), and as cloud services from providers such as Cloudflare, Akamai, and AWS.