← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Business Logic Abuse

Security Advanced
debt(d9/e7/b5/t9)
d9 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'silent in production until users hit it' (d9). The misconception field explicitly states that automated scanners cannot catch business logic flaws — semgrep and burpsuite are listed but the detection_hints note automated=no, meaning these tools require manual, domain-knowledgeable testers. Flaws remain invisible until attackers exploit them at scale in production, e.g. issuing themselves credits through negative-quantity cart abuse.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix requires mapping all valid state transitions and enforcing them server-side — this is not a single patch. Common mistakes span price recalculation, rate limiting, workflow state validation, and race condition fixes across cart, checkout, discount, and inventory subsystems. Each fix touches multiple components and requires coordinated changes across the codebase.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). Applies to web and api contexts broadly, meaning every feature involving pricing, discounts, workflows, or inventory must be designed with server-side validation of business rules in mind. It is not architectural (b7/b9) because it doesn't define the system's shape, but it does impose ongoing discipline on multiple work streams — every new feature risks introducing a new logic flaw.

t9 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'catastrophic trap — the obvious way is always wrong' (t9). The misconception is explicitly documented: competent developers routinely believe security scanners will catch business logic flaws, but they cannot. The 'obvious' approach of relying on automated tooling is always wrong for this class of vulnerability. Additionally, trusting client-submitted prices and assuming UI workflow enforcement equals server-side enforcement are deeply intuitive wrong assumptions that cause real financial harm.

About DEBT scoring →

Also Known As

business logic vulnerability workflow bypass price manipulation

TL;DR

Exploiting flaws in application workflows rather than technical vulnerabilities — bypassing payment steps, abusing discount codes, manipulating quantity fields, or racing concurrent requests.

Explanation

Business logic vulnerabilities use the application as designed but in unintended ways: negative quantities in carts (refund exploit), applying expired promo codes via replay, skipping mandatory workflow steps by manipulating URLs, race conditions on limited inventory, mass assignment of admin roles, or abusing referral systems. These are not caught by WAFs or standard security scanners because the requests are technically valid. Detection requires understanding the intended business flow and testing edge cases explicitly.

Common Misconception

Security scanners catch business logic flaws — automated scanners test for technical vulnerabilities; business logic flaws require manual testing with domain knowledge of the application's intended behaviour.

Why It Matters

Price manipulation vulnerabilities have cost e-commerce companies millions — a $-1 item in a cart that passes checkout logic can result in credits being issued to attackers at scale.

Common Mistakes

  • Trusting client-submitted prices — always recalculate price server-side from the product database.
  • No rate limiting on discount code attempts — brute-forceable codes at scale.
  • Not validating workflow state transitions — user can jump from step 1 to step 5 by manipulating URLs.
  • Race conditions on inventory checks — check-then-act patterns allow overselling under concurrent load.

Code Examples

✗ Vulnerable
// Client-controlled price — exploitable:
POST /checkout
{"items": [{"id": 42, "qty": 1, "price": 0.01}]}
// Server trusts submitted price — charges $0.01 for $99 item

// Negative quantity exploit:
{"items": [{"id": 42, "qty": -1}]}
// Cart total becomes negative — store owes the attacker
✓ Fixed
// Always recalculate server-side:
public function checkout(array $items): Money {
    $total = Money::zero('GBP');
    foreach ($items as $item) {
        // Fetch price from DB — never trust client:
        $product = $this->products->findOrFail($item['id']);
        // Validate quantity is positive integer:
        $qty = max(1, (int) $item['qty']);
        $total = $total->add($product->price->multiply($qty));
    }
    return $total;
}

Added 16 Mar 2026
Edited 22 Mar 2026
Views 42
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 2 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 2 pings T 0 pings F 2 pings S 0 pings S 0 pings M 1 ping T 1 ping W 0 pings T 0 pings F 2 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 1 ping S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Google 6 Amazonbot 6 Ahrefs 4 Scrapy 4 Perplexity 3 SEMrush 3 Unknown AI 2 Claude 2 ChatGPT 2 Meta AI 1 Sogou 1 PetalBot 1
crawler 29 crawler_json 6
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: High
⚡ Quick Fix
Map out all valid state transitions in your domain and enforce them server-side — e.g. a cancelled order cannot be re-ordered; a refund cannot exceed the original payment
📦 Applies To
any web api
🔗 Prerequisites
🔍 Detection Hints
Price manipulation via parameter tampering; negative quantity in cart; applying discount codes multiple times; purchasing at old price after price change
Auto-detectable: ✗ No semgrep burpsuite
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: High ✗ Manual fix Fix: High Context: File Tests: Update
CWE-840 CWE-841


✓ schema.org compliant