A simple diagram of the Business Logic Flaws risk path
Risk path: an input or context crosses a security boundary.
A simple three-step test path for Business Logic Flaws
Testing path: establish a baseline, make one controlled change, and verify the effect.

01Issue

Overview

Business logic is the set of product rules that define how a workflow should behave: who may approve an order, when a booking is valid, or how a discount is calculated. A business-logic flaw exists when the application permits a sequence or state change that breaks those rules. Each request can look normal on its own, while the combined outcome is not allowed.

Common causes

  • The server checks requests separately but does not enforce the whole workflow or allowed state transitions.
  • The client supplies values such as price, ownership, approval, or completion status that should be decided by the server.
  • A one-time operation can be repeated or replayed without an atomic state change.
  • The interface hides a step or button, but the server endpoint does not enforce the same rule.

References: OWASP Business Logic Security Cheat Sheet ↗OWASP WSTG: Business Logic Testing ↗

02Examples

EXAMPLE

Hypothetical booking flow: a test reservation moves from draft to confirmed only after payment is recorded. Send the normal confirm request before the payment step, then inspect the reservation record and payment ledger. A 200 response is only an indicator; a confirmed flaw requires evidence that the server changed the reservation to a state the rules do not permit.

03Impact

There must be a clear product rule and a reachable request sequence that violates it. The test must show a real difference in authoritative state or outcome, not merely a hidden button, unusual response, or repeated message.

Depending on the rule, a flaw may grant an unintended benefit, bypass a workflow step, alter a record, or cause a financial or operational loss. State the result actually demonstrated: skipping a confirmation step does not automatically prove a payment was captured or a balance changed.

04Testing

Test cases

1. Check whether the workflow permits a prohibited outcome

Identify a business rule and perform a test action that challenges it. Verify the final state in the record or transaction ledger.

Example: A test discount may be intended for one use. Check the redemption record if it appears to apply twice.

POST /api/orders/TEST-1/apply-coupon HTTP/1.1
Host: app.example.test
Content-Type: application/json
 
{"coupon":"DEMO-ONCE"}

2. Check skipped or reordered workflow steps

Compare the intended sequence with direct requests to later steps. Use the same test record and inspect whether the server enforces each required transition.

Example: An order may require approval before confirmation. Check the final status when confirmation is attempted early.

POST /api/orders/TEST-1/confirm HTTP/1.1
Host: app.example.test
Content-Type: application/json
 
{}

3. Compare roles, limits, and competing actions

Review role-specific actions, quantity limits, and related endpoints. Where relevant, compare sequential and simultaneous requests using resettable data.

Example: A 200 response is not a second transaction by itself. Check the authoritative state after processing completes.

Testing references: OWASP Business Logic Security Cheat Sheet ↗OWASP WSTG: Business Logic Testing ↗

05Mitigation

Enforce business rules on the server at the point where state changes. Model valid states and transitions explicitly, derive sensitive values from trusted records, and use database transactions or conditional updates for one-time operations. Apply the same checks across UI, API, scheduled jobs, and retry paths. Log rejected transitions without exposing sensitive data.

Retest

Repeat the invalid sequence, value changes, replay, and alternate-route checks with resettable test records. Verify authoritative state and transaction records, then confirm the normal workflow still completes.