Business logic vulnerabilities occur when an application permits technically valid actions that violate its business rules. Attackers often need no conventional injection: they alter the sequence, quantity, price, role or state of an intended process.
How do logic flaws arise?
Developers implement the expected path but overlook unusual combinations. Controls exist only in the interface, only at the first process step or in one microservice. Concurrent requests, reused coupons, negative values or skipped approvals can then place the system in a technically valid-looking but impermissible business state.
What are typical examples?
| Area | Example |
|---|---|
| E-commerce | Price or quantity is changed, a discount reused or payment reversed after dispatch. |
| Finance | A transaction limit is bypassed through splitting, concurrency or currency conversion. |
| Approvals | A mandatory step is skipped or the same person requests and approves. |
| Subscriptions | Trial, upgrade, cancellation and refund are combined improperly. |
| Tenants | A legitimate export or invitation function affects another organization's data. |
| API | A sensitive business flow can be automated, scaled or executed out of order. |
Why do scanners rarely find them?
Scanners recognize known technical patterns. They do not know that a customer may receive a reward only once or that every payout needs a second approval. Logic flaws require an understanding of business rules, roles, economic value and valid state transitions. Automation can execute variants, but the decisive hypothesis usually comes from manual analysis.
How are business logic flaws prevented?
- Document business rules, invariants, roles and prohibited state transitions explicitly.
- Calculate security-relevant values server-side from trusted data.
- Authorize every step independently and never trust a previously displayed interface.
- Use idempotency, transactions, locks and atomic limits against replay and race conditions.
- Add unusual quantities, prices, sequences and roles to automated negative tests.
- Monitor anomalous process patterns with material business impact.
Code example: never accept prices from the request
Vulnerable: the client supplies its own price and discount.
$total = $request->integer('quantity') * $request->float('unit_price');
$total -= $request->float('discount');
Order::create(['user_id' => $request->user()->id, 'total' => $total]);
Safer: product, price and discount policy are obtained on the server.
$product = Product::findOrFail($request->integer('product_id'));
$quantity = max(1, min($request->integer('quantity'), 20));
$subtotal = $product->current_price * $quantity;
$discount = $couponService->calculateFor($request->user(), $subtotal);
Order::create([
'user_id' => $request->user()->id,
'total' => max(0, $subtotal - $discount),
]);
This still needs a transaction, idempotency and atomic coupon redemption. The important boundary is that the client selects a product and quantity but does not define the commercial rules.
How are they tested?
Testers model actors, values and states and first complete the normal process. They then vary parameters, sequence, roles, timing, concurrency and interruption points. Direct API calls bypass interface restrictions. Refunds, invitations, exports, approvals, account recovery and transitions between free and paid features are particularly productive areas.
How is risk assessed?
An unusual flow becomes a vulnerability only when it violates a security-relevant business rule. The report should explain prerequisites, attainable state, repeatability and economic or regulatory consequence. For scalable abuse, detectability and aggregate loss matter more than the value of one test transaction.
Thank you for your feedback! We will review it and optimize this content.
Do you have feedback on Business Logic Vulnerabilities? Tell us!
Additional Services
Comprehensive IT security solutions for complete protection
Red Teaming
Simulation of real attacks on your company including people, infrastructure and processes. A comprehensive approach to testing your entire security strategy.
Learn morePhishing Exercises
Practical phishing simulations to raise employee awareness. Increase awareness and reduce the risk of successful email-based attacks.
Learn more