Business Logic Flaws in Pricing
What you'll learn: How attackers exploit weaknesses in pricing logic to manipulate costs and steal value from applications.
What Are Pricing Logic Flaws?
Business logic flaws in pricing occur when applications fail to properly validate or recalculate prices on the server side. Instead of trusting the backend to determine the final cost, vulnerable applications accept price information directly from client requests—allowing attackers to modify prices, quantities, or totals to their advantage.
Think of it like a grocery store checkout where the cashier blindly trusts the price tags you bring to the register instead of scanning items themselves. You could swap tags or write your own!
Common Pricing Manipulation Techniques
Parameter Tampering
Attackers modify hidden form fields, API parameters, or cookies containing price values:
- Changing
price=100.00toprice=1.00in a request - Modifying discount percentages or coupon codes
- Altering tax or shipping calculations
Negative Quantities
Exploiting insufficient validation on quantity fields:
- Submitting
quantity=-1to receive credit instead of paying - Using negative values to manipulate cart totals
- Combining negative and positive quantities to zero out costs
Calculation Flaws
Exploiting weak math validation:
- Integer overflow/underflow in total calculations
- Rounding errors that accumulate
- Missing server-side recalculation after client modifications
Why This Happens
Applications often pass pricing data through the client for convenience—storing it in hidden fields, cookies, or API requests. When the server blindly trusts these client-controlled values instead of recalculating prices from authoritative sources (databases, pricing APIs), attackers can inject fraudulent amounts.
Key Takeaway: Never trust client-supplied pricing data—always recalculate prices server-side using authoritative sources and validate all quantities and calculations before processing transactions.