BERRY9 IT Services, home +91 86868 92922

WAF vs Penetration Testing: Does a Firewall Replace It?

Many companies put a web application firewall in front of their site and conclude that a penetration test is no longer needed. The firewall is a useful layer, but it solves a different problem. It filters traffic that looks like a known attack; a penetration test finds the weaknesses that traffic can reach, including the ones that look completely normal.

Web applications · By Thimmagurudu Bathini · Published · 5 min read · Last reviewed

What a WAF does well

A web application firewall sits between visitors and your application and inspects each request. It is good at blocking the crude, repetitive traffic that hits every public site: obvious injection strings, scanner fingerprints, floods from a single address and requests for files that should not exist. It also gives you one place to apply a rule quickly when a new flaw is announced in software you run, which can buy time before a patch is ready. Those are real benefits, and they are the reason we do not tell clients to switch one off.

What a WAF cannot see

A firewall judges requests by their shape. The most damaging web flaws have a normal shape:

  • Broken access control. A customer who changes an order number in a request to read someone else's order sends a perfectly valid request. Nothing in it looks like an attack.
  • Business logic flaws. Applying a coupon twice, skipping a payment step or abusing a refund flow uses the application exactly as built. See our article on IDOR and business logic flaws.
  • Weak authentication and sessions. A login with no limit on attempts, a reset link that never expires or a token that can be reused all pass through a firewall unchanged.
  • Flaws behind the login. Many firewall rules are tuned for anonymous traffic, while the riskiest features sit behind an account.

These are the same weaknesses that top the current OWASP list, and they are found by a person who understands how your application is supposed to work. The OWASP Top 10:2025 summary explains why access control comes first.

Attacks that get around a WAF

Rule-based filters can often be bypassed by changing how the same payload is written: a different encoding, a split request, an unusual content type, or a path the firewall was never configured to cover. A firewall in front of one hostname does nothing for an older server that still answers directly on its own address, which is a common finding in an external test. A tester tries these routes on purpose, then reports both the flaw and the way past the filter.

How we test an application that has a WAF

There are two usual approaches, and the choice should be written into the scope:

  1. Test as an attacker would. The firewall stays on and blocks what it blocks. This shows how much protection it adds in practice, but it can hide weaknesses that a patient attacker would still reach.
  2. Test with the tester's addresses allowed. The firewall stays on for everyone else, and the tester's source addresses are exempted for the test window. This lets the test cover the application itself, and a shorter separate step then checks what the firewall would have caught.

For most first tests the second approach finds more per day of effort. Tell us which one you want when you describe the scope, and say whether the firewall is managed by a third party that must be warned before testing starts.

Fix the code, keep the firewall

When a test finds a flaw, a firewall rule can be a sensible stopgap while the code is changed, but it should not be the permanent fix. The weakness stays in the application, and the next person to find a way around the rule finds it again. Record the rule as temporary and close the finding when the code is corrected.

Next step

If your application already sits behind a firewall, that is a good starting point for a conversation, not a reason to skip testing. Read how our web application penetration testing works, or send an inquiry and describe your setup.

Written by Thimmagurudu Bathini, BERRY9 IT SERVICES PRIVATE LIMITED, Hyderabad. Questions about your own systems? Request a scoping call or call +91 86868 92922.

Plan your next security test

Tell us what needs testing and when you need it done, and we will propose a scope and timeline. We respond within 24 hours. If you would rather talk first, call or write to us.