Web application security
Business logic flaws: what scanners cannot model
The most expensive bugs are usually in the rules, not the code. They need a tester who understands what the product is supposed to do.
Why scanners miss them
A scanner matches patterns: a parameter name, a payload, a response signature. Business logic flaws have no signature. The request that abuses a discount limit looks exactly like the request that applies a discount, and the response looks like a normal successful response.
Finding them requires an intent that the product should refuse and that the server does not refuse. That intent comes from understanding the workflow — which is why the most productive testers are the ones who spend time with the product team before they start poking it.
The classes we look for
Payment and pricing logic. Can the price be changed on the client side and accepted on the server? Can a negative quantity, a currency mismatch, or a coupon be combined in a way the business did not intend? Can a discount be applied to an item that was never eligible for it?
Workflow bypass. Does the state machine actually enforce its order? Can a user skip the approval step, mark an invoice as paid without paying it, or trigger the fulfilment step directly? Does the server trust a client-supplied status field?
Limit and race conditions. Is there a one-time action — a credit, a referral, a withdrawal, a discount — that can be triggered twice at the same moment because the check and the action are not atomic?
Referral and incentive abuse. Can a referral be counted against a self-referral, a duplicate account or a disposable address? Is the reward capped where the business thinks it is capped?
How we test them
We write the rules down. Which transitions are legal, which values are legal, which orderings are legal, which actions are meant to be one-time. That list is usually produced with the client, and it is usually shorter than anyone expects — often a dozen rules for an entire workflow.
Then we break each rule in isolation: send the illegal value, send the illegal ordering, send the illegal transition, send the same action twice. Where a rule has a limit, we find the boundary and then we check whether the boundary is enforced atomically or only in the interface.
The output is deliberately concrete. "The referral credit can be claimed twice" is a finding. "POST /referral/claim with the same referral token in two parallel requests returns HTTP 200 twice and credits the balance twice" is a finding somebody can fix on Monday.
Fixing the rule, not the request
The recurring mistake is a fix that blocks one client. If the discount logic is validated in the web tier but the API accepts a different shape, the fix has to live where the rule lives — in the domain layer, enforced on every path that reaches it.
The other recurring mistake is a fix that depends on a race being unlikely. A check that reads the current count and then writes it, without a constraint at the database level, is a rule that has not been fixed. The safe version is a unique constraint, an idempotency key, or a transaction with the right isolation — so that the second request fails by design rather than by luck.
What this means for your team
Budget for the modelling step. The hour spent writing down the rules pays for itself many times over, because it turns an open-ended test into a checklist — and a checklist is what makes coverage defensible at the end of the engagement.
Then treat the rules as part of the security surface. When the pricing model changes, the rules change, and the rules should change in a version-controlled place that the tests can read.