Price and Quantity Manipulation

A business logic flaw where the server trusts or fails to bound client-influenced monetary and numeric values (price, total, quantity, amount), so the charge it computes no longer reflects the real order.

How it works

The root cause is one of two server mistakes: it accepts a value it should derive (price, total), or it derives from a value it never bounds (quantity, amount).

PatternServer mistakeReported outcome
Trusted totalUses a client-supplied total instead of recomputing from the catalog$100 item settled for a fraction of the price (Top bugs that paid)
Off-menu quantityPrice keyed to fixed quantity tiers; an unlisted quantity gets no priceSubtotal of zero, only shipping and tax charged (I almost ordered a product for free)
Negative valuesNo > 0 check on quantity or amountNegative totals, credits, or corrupted ledgers (CRM pentest)
Integer overflow / castQuantity beyond the 32-bit signed range wraps or is cast to 0Order total of 0 (Integer overflow, ₹0)
Exposed pricing operationPricing and refund mutations reachable without authorizationpriceOverride, refundIssue callable from an anonymous session (Red Agent: airline BOLA)
  • Business logic is code that mimics real-world business decisions. Testing it means challenging the developer’s assumptions about how users behave, not hunting parsing bugs (Web AppSec Interview Questions).
  • OWASP WSTG covers this under WSTG-BUSL. Its main examples are price manipulation and payment-flow bypass (WSTG methodology).
  • A disabled button in the UI is not enforcement. In the money-envelopes case, the only thing blocking checkout of the inconsistent order was a client-side CSS state (I almost ordered a product for free).
  • Mass Assignment is the same failure on the write side: writable attributes can add balance or assign negative resources (Web AppSec Interview Questions).

Testing heuristics

Notable cases

  • An e-commerce checkout trusted a client-side total that included gift wrap and tax. The author reports a $4,200 payout for this checkout flaw (Top bugs that paid).
  • An integer overflow on quantity produced a ₹0 cart on a large e-commerce platform (Integer overflow, ₹0).
  • Off-menu quantity: ~Rs. 4,177 of goods for Rs. 177 (money-envelopes).
  • A CRM payments table held records with amounts of -99999 and -3000 marked paid. This was rated CWE-840, CVSS 6.5 (CRM pentest).
  • In an airline GraphQL API, the price-override and refund mutations sat behind broken object-level authorization (Red Agent: airline BOLA).
  • Intigriti’s October 2026 CTF was a deliberately vulnerable store built around price manipulation (Bug Bytes #241).

Defenses

  • Recompute every price, discount and total on the server from authoritative catalog and order state. Treat client totals as display-only (Top bugs that paid).
  • Enforce explicit bounds (amount > 0, quantity within an allowed set or range) and use overflow-safe arithmetic and types (Integer overflow, ₹0, CRM pentest).
  • Reject a line item that has no resolvable price instead of defaulting it to zero.
  • Allowlist writable fields so price, balance and credit can’t be bound from request bodies (Mass Assignment).
  • Put pricing, override and refund operations behind function-level authorization (Function Level Authorization).

Sources