What is a web application firewall (WAF)?

A web application firewall (WAF) is a specialized firewall that protects web applications and the servers behind them from common web-based attacks, such as SQL injection and cross-site scripting (XSS). A WAF monitors and filters the HTTP and HTTPS traffic sent to a web application and blocks malicious requests before they reach the application or server.

Unlike a traditional network firewall, which controls traffic by port and protocol, a WAF examines the content of web requests to catch attacks that a network firewall is not designed to stop. WAFs can be deployed in the cloud, on premises, or as a hybrid, making them essential for any organization that runs web or mobile applications.

What is a WAF?

Web application firewalls (WAFs) are a critical security defense for websites, mobile applications, and APIs. They monitor, filter, and block data packets to and from web applications, protecting them from threats. WAFs are designed (trained) to detect and protect against dangerous security flaws that are most common within web traffic. This makes them essential for online businesses like retailers, banks, healthcare, and social media, which need to protect sensitive data from unauthorized access. WAFs can be deployed as network-based, host-based, or cloud-based solutions, providing visibility into application data at the HTTP application layer.

Since web and mobile applications and APIs are prone to security risks that can disrupt operations or exhaust resources, web application firewalls are designed to counter common web exploits like malicious bots. WAFs safeguard against threats that compromise availability, security, or resources including zero-day exploits, bots, and malware.

How does a WAF work?

A WAF works by inspecting HTTP requests and applying predefined rules to identify malicious traffic. It can be software, an appliance, or a service. The WAF analyzes the following key parts of HTTP conversations:

  • GET requests: These requests retrieve data from the server.
  • POST requests: These requests send data to the server to change its state.
  • PUT requests: These requests send data to the server to update or create.
  • DELETE requests: These are requests to delete data.

The WAF also analyzes the headers, query strings, and body of HTTP requests for malicious patterns. If the WAF finds a match, it will block the request and send an alert to the security team.

Why is WAF security important?

WAFs are crucial for the security of online businesses. They protect sensitive data, prevent leaks, prevent malicious code from being injected into the server, and meet compliance requirements like Payment Card Industry Data Security Standard (PCI DSS). As organizations increasingly use more web apps and IoT devices, attackers try to target their vulnerabilities. Integrating a WAF with other security tools, such as endpoint protection and identity security, creates a layered defense strategy.

How does WAF contribute to web app security?

Many applications today are created using a combination of home-grown, third-party, and open-source code. WAFs add an extra layer of security to inadequately built or legacy applications and help to enhance secure design practices by blocking common attack vectors and preventing malicious traffic from reaching the application. Below is a list of significant advantages specific to WAFs.

  • WAFs can block malicious traffic before it reaches a web application, preventing data breaches and other attacks.
  • WAFs can help to protect sensitive data, such as credit card numbers and customer Personally Identifiable Information (PII), from unauthorized access.
  • WAFs can help to meet compliance requirements, such as PCI DSS, by blocking traffic that violates those requirements.
  • WAFs can work in conjunction with other security tools, such as an intrusion detection system (IDS), intrusion prevention system (IPS), and firewalls, to create a layered defense that is more effective at preventing attacks.

What is the difference between WAF and other tools?

What is the difference between WAF and a network firewall?

A next-generation firewall (NGFW) protects a broad range of network traffic, filtering by IP, port, and protocol and adding application awareness, intrusion prevention, and threat intelligence. A web application firewall is more specialized: it protects web and application servers from common web application attacks, such as SQL injection and cross-site scripting.

The key difference is how a WAF sees traffic. A WAF is typically deployed as a reverse proxy, which lets it fully inspect each web request — whether sent over HTTP or HTTPS — before passing it to the end server. This makes a WAF function like a more limited, specialized firewall focused specifically on web application traffic. Most organizations use both: an NGFW to secure network traffic broadly, and a WAF to protect the web applications and servers behind it.

For the general firewall definition, see What is a firewall?

Do web applications need a firewall?

By positioning WAF in front of web apps, it safeguards them collectively. Its effectiveness against attacks such as cross-site scripting and injection attacks is a significant feature.

How does the HTTP protocol relate to WAF?

WAF intervenes to scrutinize legitimate requests, thwarting attacks like injection, cross-site scripting, HTTP Flood, and Slowloris, ensuring safer web interactions.

What are the differences between WAF, IPS, and NGFW?

Here are the basic differences between a WAF, an IPS, and a next-generation firewall (NGFW). While an IPS is signature-based and broad in focus, operating at Layers 3 and 4, a WAF operates at the application layer (Layer 7). A WAF protects web applications by analyzing each HTTP request, and traditional WAFs ensure allowed actions based on security policies. NGFWs are advanced firewalls with integrated IPS and application-layer capabilities.

How to protect your environment

Product

Cisco Secure Web Application Firewall (WAF)

Defend your online presence and ensure that website, mobile applications, and APIs are secure, protected, and "always on."

Product

Cisco Secure Firewall

Block modern threats and achieve real-time network security, with unified access control across applications.

Product

Cisco Secure Firewall Management Center

Manage hundreds of firewalls, control policies, and block malware from one dashboard.

How does a WAF protect against vulnerabilities?

A WAF protects web and application servers from a wide range of attacks, including malicious bots. Adversaries use bots for account takeover, data scraping, and denial-of-service attacks, and bot attacks on APIs are growing as API usage increases. Effective protection combines a WAF with device fingerprinting, behavioral analysis, bot intelligence, and dedicated API protection. A strong WAF includes bot detection that recognizes evolving bots designed to evade basic defenses.

The table below maps common web application and API attack categories to the Cisco WAF and bot protection capabilities that defend against them.

Attack categoryExplanation of attack / riskCisco WAF protection technology
Broken user authenticationWeak authentication mechanisms allow unauthorized access, letting attackers bypass login screens and compromise user accounts. Examples include unauthorized access to APIs and IP-, token-, role-, and customer-based attacks.Token protection.
Excessive data exposureWhen sensitive information is improperly stored, transmitted, or disclosed, attackers can access confidential data, leading to privacy breaches. Examples include environment fingerprinting, 5XX internal server errors, and exposed HTTP response headers.Data masking; replace 500 messages.
Security misconfigurationsImproperly configured settings, permissions, or defaults create security gaps that attackers exploit to gain unauthorized access or control. Examples include incomplete or ad hoc configurations, misconfigured HTTP headers, and unnecessary HTTP methods.Data masking; replace 500 messages; autolearning.
Broken access controlBroken access control lets unauthorized users reach restricted resources, and attackers exploit it to gain unauthorized privileges. Examples include unauthorized access to APIs; IP-, token-, role-, and customer-based attacks; and access to restricted APIs.API catalog validation; IP and geo policies.
Injection / cross-site scripting (XSS)Injection attacks exploit vulnerable inputs, letting attackers insert malicious code to gain unauthorized access or manipulate data. XSS vulnerabilities let attackers inject malicious scripts that execute in users' browsers, compromising their data or sessions. Examples include SQL injection, XSS, command injection, and directory traversal.Positive security model; negative security model; API catalog validation.

Do WAFs safeguard against known and emerging threats?

WAFs are constantly updated with new rules and signatures to safeguard against both known and emerging security threats through a variety of techniques to detect and block malicious traffic, including:

  • Signature-based detection: This technique uses predefined rules to identify malicious traffic that matches known attack patterns.
  • Anomaly based detection: This technique identifies malicious traffic that does not conform to normal behavior patterns.
  • Machine learning: This technique uses artificial intelligence to identify malicious traffic that is not yet known.

How do WAFs help address the OWASP Top 10?

The Open Worldwide Application Security Project (OWASP) maintains the OWASP Top 10, the widely recognized list of the most critical web application security risks. A WAF inspects incoming web requests and blocks those that match known attack patterns, acting as intrusion prevention for web application traffic. While some OWASP Top 10 risks require secure design and coding practices to fully address, a WAF helps defend web and application servers against several of them, including:

  • Broken Access Control — a WAF enforces access policies and validates requests to help block unauthorized access to restricted resources and APIs.
  • Security Misconfiguration — a WAF masks error details and normalizes responses to reduce exposure from misconfigured settings and headers.
  • Injection — a WAF filters requests containing malicious SQL, scripts (cross-site scripting, or XSS), and other injection payloads before they reach the server.
  • Authentication Failures — a WAF adds a layer of protection against attacks that target weak authentication, such as credential stuffing and brute-force login attempts.

What are the different types of WAF deployment with examples?

WAF deployment models compared

Deployment modelStrengthsLimitationsTypical use case
Cloud-basedFast to deploy, minimal maintenance, scales on demand, delivered as a subscriptionLess direct control over the environment; depends on providerOrganizations with limited in-house security staff or cloud-native applications.
On-premises applianceHigh performance, full control, advanced customizationHigher capital cost; requires staff to manage and updateOrganizations with strict data-control needs or high-throughput requirements.
Host-based / hybridFlexible; combines on-premises control with cloud scalabilityMore complex to operate and tune across two modelsOrganizations transitioning to cloud or needing both control and scale.

Here are several WAF deployment options that integrate WAFs into organizational cybersecurity infrastructure in the cloud.

Cloud-based

This is a newer deployment option, where the WAF service is hosted in the cloud and delivered as a subscription.

Cloud-based AWS

Optimal for organizations with limited in-house security resources. Enjoy hassle-free deployment, with a third-party managing WAF security on AWS, allowing you to focus on core activities.

Read the Secure Cloud for AWS Design Guide (PDF)

Cloud-based Azure

A bundled cloud security solution. Quickly deploy security policies in a cost-effective manner, enjoying the benefits of WAF protection without complexities.

Get the Secure Cloud for Azure Design Guide (PDF)

Cloud-based Kubernetes WAF

Scalable application security for continuous integration and continuous delivery/continuous deployment (CI/CD) environments is orchestrated by Kubernetes.

On-premises

This is the traditional deployment option, where the WAF virtual or hardware appliance is installed on site at the organization's data center. Suitable for organizations requiring flexibility, high performance, and advanced security.

Hybrid

This is a combination of the on-premises and cloud-based deployment options, where the WAF appliance is installed on site and the cloud-based service is used to supplement it.

Common questions about web application firewalls

A web application firewall (WAF) is a specialized firewall that protects web and application servers from common web application attacks. It is typically deployed as a reverse proxy, which gives it full visibility into the HTTP and HTTPS requests sent to an application. The WAF inspects each request and blocks malicious ones in line with risks like the OWASP Top 10, including SQL injection and cross-site scripting (XSS).

A WAF inspects incoming HTTP and HTTPS requests against a set of rules, analyzing the request method, headers, query strings, and body for malicious patterns. When a request matches a known attack pattern or violates policy, the WAF blocks it and can alert the security team.

A network firewall, such as a next-generation firewall (NGFW), secures a broad range of network traffic by filtering on IP, port, and protocol, with added capabilities like application awareness and intrusion prevention. A web application firewall is more specialized: it protects web and application servers from common web application attacks by inspecting the content of HTTP and HTTPS requests. Most organizations use both — an NGFW to secure network traffic broadly, and a WAF to protect the web applications and servers behind it.

A WAF protects against common web application attacks, including SQL injection, cross-site scripting (XSS), broken access control, and malicious bots. Many of these map to the OWASP Top 10, the recognized list of the most critical web application security risks.

Neither is universally better; the right choice depends on your needs. A cloud WAF deploys quickly, scales on demand, and requires little maintenance, while an on-premises WAF offers more control and performance for organizations with strict data-control or high-throughput requirements. Many organizations use a hybrid of both.

IT professional reviewing network data on a tablet in a data center

Decide which Cisco firewall is right for you

Answer the following questions to find out which offering is the best fit for your needs

Solution brief

Cisco Secure WAF Integrated Application Protection

Stay ahead of evolving web attacks and protect your web applications with one of the most used network security products. Learn what a web application firewall can do for your business.