Business logic attacks are harder to stop than most because every request in them is valid. A scanner finds nothing wrong with a login, a coupon code or a refund request, since the application is doing exactly what it was built to do, just in an order or quantity nobody planned for. The fix sits in how the rules are designed and tested, and no product switches it on for you. Imperva’s explanation of business logic vulnerabilities makes the same point about firewalls and scanners missing them.
| Code flaw (SQL injection, XSS) | Business logic flaw | |
| What the attacker sends | Malformed or hostile input | Valid requests used in the wrong way or order |
| Scanner or WAF sees it | Often | Rarely |
| Root cause | Missing input handling | A rule that was never written down or enforced |
| Fix | Patch the code path | Change the rule, then test it |
The difference in practice
A bulk discount is a typical case. An attacker orders enough to reach the discount tier, cancels part of the order, and keeps the lower price on what is left. Nothing is injected, and nothing malformed arrives. The application simply never checked that the discount depends on the final quantity.
Dynamic testing tools mostly miss this, since they look for known technical patterns. Our overview of dynamic application security testing shows what they do find.
Test the rules, not only the code
Someone has to write the rules down before anyone can test them: what a user may do, how many times, in what order, and what must be true at each step.
- List every flow where money, stock, access or personal data changes hands
- For each, write the abuse case: skip a step, repeat a step, send two at once, change a number
- Run those cases by hand against a staging copy, because automation rarely thinks of them
It is slow, and it is mostly a job for a person with a suspicious mind. Do it for the five flows that would hurt most, not for all fifty.
Common attacks
Three families come up most often. Account takeover, through the features meant to help locked-out users. Race conditions in anything that checks a limit and then updates it. And abuse of flows that are legitimate in small numbers and harmful at scale.
Account takeover tends to run through password recovery and account update functions. A reset link sent to an address nobody verified, a reset token that can be guessed, or a login form with no rate limit on attempts each hand an attacker an easy route.
Race conditions are the subtle one. PortSwigger’s Web Security Academy describes the limit overrun case with a discount code: the application checks the code has not been used, applies the discount, then records that it was used. Between the check and the update there is a short window, and several requests sent at nearly the same moment can all pass the check before any of them records the use.

The fix PortSwigger recommends is to make that state change atomic using the datastore’s own concurrency features, such as running the check and the update in one database transaction, with a uniqueness constraint as a backstop.

The third family has an official name: OWASP’s API Security Top 10 (2023 edition) lists it as unrestricted access to sensitive business flows. Its examples show the range:
- A bot buys most of the stock of a high-demand console at launch and resells it at a markup
- A user books most seats on a flight with no cancellation fee, cancels them all at once, and rebooks cheaply after the airline discounts the empty seats
- A script creates accounts in bulk to farm referral credits
The common thread is a flow that is fine for one human and ruinous for ten thousand scripted requests. OWASP’s prevention advice starts with the business side: decide which flows would hurt you if overused, then pick protections that match the risk, such as detecting non-human timing, device checks or human verification.
Supply chain attacks are often listed next to these, but they are a different thing. The 2020 SolarWinds incident, where malicious code was added to software updates that customers then installed, abused trust in a vendor rather than a rule in an application. It matters, though it needs its own controls.
Defenses
Enforce every rule on the server. Prices, quantities, discounts and user roles should be recalculated there, never taken from what the browser sent. Where the check and the change belong together, put them in a single transaction. Rate-limit the sensitive flows, and keep logs good enough to spot a pattern such as one account redeeming many codes in a minute.
Our piece on API security practices covers the API side in more detail.
Is a WAF enough?
No. A web application firewall matches known attack patterns, and a logic abuse looks like normal use. It can still help with rate limiting and bot filtering, which cover part of the OWASP list above.
How often should this be tested?
When the rules change. A new discount type, a new refund path or a new integration is a new set of abuse cases, so add the test to the same ticket as the feature.
Pick one flow that touches money and write its abuse cases this week.
- How to Redo in VS Code (Shortcuts and Fixes) - December 5, 2026
- Top MySQL CDC Tools for Streaming Changes to a Data Warehouse - December 4, 2026
- PyCharm Tutorial: From Install to Your First Debug Session - December 3, 2026



