# Web Application Firewall (WAF)

> A filter that reads each web request. It blocks known tricks used on websites.

**Field:** Infrastructure  
**Category:** Security  
**Also known as:** WAF, Web App Firewall, WAF Rules

## Think of it like

It is like a guard who opens each box at the door. A bad thing hid inside gets caught.

## Definition

A web application firewall is a filter that reads web requests before they reach a website. A normal firewall only checks where traffic comes from and which port it uses. A WAF looks inside each request for known tricks, like SQL injection or cross-site scripting. It blocks the bad requests and lets the rest through. It can run in front of one site, or as a service in front of many.

## Example

Lucy's shop has a WAF in front of it. A bot sends a search box full of SQL code. The WAF spots the trick and blocks the request before the shop sees it.

## Why it matters

Web attacks come in through port 443, which a normal firewall must leave open. A WAF guards that open door.

## Common mistake

Thinking a WAF fixes weak code. It blocks known tricks, but a new one can slip past, so the app still needs fixing.

## Three principles

- **Reads the request.** Not just the port and address.
- **Known tricks.** Rules match common web attacks.
- **Extra layer.** It does not replace safe code.

## Related terms

- [Firewall](https://learn.benibix.com/term/infrastructure/firewall)
- [Distributed Denial of Service (DDoS)](https://learn.benibix.com/term/infrastructure/ddos-attack)
- [SQL Injection](https://learn.benibix.com/term/development/sql-injection)
- [Cross-Site Scripting (XSS)](https://learn.benibix.com/term/development/cross-site-scripting)
- [OWASP Top 10](https://learn.benibix.com/term/development/owasp-top-10)

![Two requests travel from the internet toward a website. Both pass a network firewall, because both use port 443. Then a web application firewall opens each one. A normal search request goes on to the website. A request with SQL code hidden in it is stopped with a cross.](https://learn.benibix.com/diagrams/inf3-waf.svg)

---

Source: https://learn.benibix.com/term/infrastructure/web-application-firewall
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
