Welcome to Week 1 of my new series, Hack & Tell—a journey sparked by the common questions I encounter during my pentesting engagements. In this first week I will be diving into the world of Web Application Firewalls (WAFs), we’ll explore why they are crucial for protecting web applications and provide some background before delving into the common methods by which they can be bypassed.
So, I’ve started with Web Application Firewalls (WAFs) because as even as diverse as our testing engagements can be, web apps still likely make up half of the testing we do. So, when my clients ask me, "What's most crucial for securing my app?" my immediate response is always: Secure your code base! But that's just one layer of the security onion. This then leads to further questions… how quickly can you update your application as new exploits surface? Do you have direct control over your source code to deploy security updates promptly? In many cases, the answer is no or not fast enough.
We can all wish for a world where a securely developed app could safely exist without threats, but the reality often tells a different story. So yes... lets keep building secure web apps but in the meantime the importance of Web Application Firewalls (WAFs) is growing more than ever as our first line of defence.
As a spoiler, but at a high level WAF bypasses typically occur due to one or a combination of the following reasons:
Web Application Firewalls serve as a critical line of defence for web applications. They are deployed to monitor, and when necessary, block internet traffic to and from a web application to protect against malicious attempts to exploit vulnerabilities. Common threats that WAFs guard against include SQL injection, Cross-Site Scripting (XSS), and file inclusion—each capable of causing significant damage.
WAFs provide a barrier against these attacks by analysing incoming traffic and applying rules to block harmful requests. The importance of WAFs cannot be overstated, especially as the frequency and sophistication of web application attacks continue to rise.
Real-world data and recent cyber incidents underscore the crucial need for effective WAFs. Below are some recent statistics I’ve come across that echo my experiences:
The consequences of not deploying an effective WAF are starkly illustrated by the 2017 Equifax breach. Hackers exploited a vulnerability in the Apache Struts web framework—an attack vector that a properly configured WAF could have mitigated against. This oversight led to the exposure of sensitive personal information of approximately 147 million people, emphasizing not just the financial but also the reputational damage that such breaches entail.
Moreover, in 2020, a major software provider faced a significant breach due to a failure to update its WAF configurations, allowing attackers to exploit known vulnerabilities that should have been shielded by the WAF. This incident further highlights the necessity of not only having a WAF in place but also ensuring it is well-configured and updated in line with emerging threats and vulnerabilities.
WAFs operate by intercepting and analysing every HTTP request before it reaches the web application. They employ a set of rules, known as policies, which define what kinds of behaviour are considered safe. These rules can block known attack vectors and filter out behaviour patterns that suggest malicious intent.
Web Application Firewalls (WAFs) can be deployed in several ways, each tailored to meet specific network and security needs. A lesson learned from a previous project, where we rolled out a new EDR solution requiring cloud-synced endpoint agents, highlights this point. We initially faced some challenges due to the WAF being configured in a Sideband deployment. Although it was set to allow traffic, we experienced unexpected blocks that led to several sleepless nights troubleshooting the issue. Understanding the nuances of each deployment model can help prevent such scenarios:
Deploying a WAF is not just a technical decision but a strategic one. It involves aligning the organisation's risk appetite with budget considerations. For many, the challenge lies in justifying the initial investment and ongoing operational costs against the potential financial impact of web application attacks.
What challenges have you faced in deploying a WAF? Technical or non technical… Did the new WAF break everyone’s internet? Have budget constraints influenced your approach to meeting your organisation’s risk appetite?
Comment and share your experiences or insights below. Rolling out a shiny new security tool isn’t always a smooth process as we have discovered numerous times. Proper tuning and set up is crucial for a WAF to be effective and embraced by the business!
Often the best tool in the shed provides no value if it's set up to fail! Next week, we'll dive into the common vulnerabilities and configuration flaws that can undermine the effectiveness of WAFs. Understanding these pitfalls is crucial for maximizing the security benefits of your WAF deployment. Read more here.