Business Logic Vulnerabilities
Business Logic Vulnerabilities
Business logic vulnerabilities are the hardest class to detect because nothing in the code looks wrong; each step is valid on its own. The flaw is in the sequence and the assumptions: that payment happens before fulfillment, that a coupon is used once, that a price comes from the server. Automated scanners cannot reason about these rules, which is exactly why they are so often missed and so valuable to catch.
Workflow Bypass
CWE-840- What it is
- A required step, such as payment, verification, or approval, can be skipped by calling a later step directly.
- Why it matters
- Goods shipped without payment, accounts verified without proof, approvals granted without review.
- How to check
- Confirm each step re-checks that its prerequisites actually completed, rather than trusting the client to arrive in order.
Price & Quantity Manipulation
CWE-840- What it is
- The server trusts a price, quantity, or discount sent by the client, allowing negative amounts or arbitrary values.
- Why it matters
- Purchases at attacker-chosen prices, negative quantities that credit the account, free or paid-to-buy transactions.
- How to check
- Derive price and totals on the server from trusted data; never accept them from the request.
Replay & Missing Idempotency
CWE-294- What it is
- A one-time action, such as redeeming a coupon or token, can be replayed because there is no idempotency or single-use guarantee.
- Why it matters
- Coupons redeemed repeatedly, balances credited multiple times, duplicate side effects.
- How to check
- Enforce single use with idempotency keys or server-side state, not just by removing the button after the first click.
Business-Flow Race Conditions
CWE-362CWE-367- What it is
- Concurrent requests exploit a gap between checking a condition and acting on it, such as spending or redeeming a balance twice.
- Why it matters
- Double-spend, inventory oversell, limit bypass under concurrency.
- How to check
- Protect critical transitions with atomic operations or locks so two requests cannot both pass the same check.
In-depth guides
Authentication Bypass by Capture-replay
An attacker captures a valid authentication request or token and resends it to gain access, because the server does not detect the replay.
CWE-362Concurrent Execution using Shared Resource with Improper Synchronization
Two or more operations access a shared resource at the same time without proper synchronization, producing results the code never intended.
CWE-367Time-of-check Time-of-use (TOCTOU) Race Condition
A program checks a condition and then acts on it, but the state can change in between, so the action runs on a condition that no longer holds.
CWE-840Business Logic Errors
An application fails to enforce its own business rules, so a user abuses a legitimate workflow to reach an outcome the rules were meant to prevent.
Related coverage
Check your code for business logic vulnerabilities
Tethlyn Audit checks your codebase for business logic vulnerabilities and more, then ranks each finding by real exploitability and data sensitivity.