Business Logic Vulnerability: Price Manipulation
Introduction
Business logic vulnerabilities are security weaknesses that exist in the way data and transactions are processed within an application. The most common, and dangerous type, is price manipulation, where there is exploitation of logical flaws in a certain e-commerce and financial systems wherein one buys products or services at a reduced or zero-cost basis.
How Price Manipulation Works
This happens when the application does not validate price information properly. This allows the attacker to change the price of the items just before finalizing the transaction. It could be a case of either client-side validation or API interaction or even database logic gone wrong.
Popular Techniques for Price Manipulation
1. Tampering with Hidden Form Fields
Many e-commerce platforms use hidden HTML form fields for storing price information. Attackers can use browser developer tools to change the price before submitting.
Example:
- <inputtype=”hidden” name=”price” value=”100″>
- Changing the value from 100to 10 before submitting the form.
- Converting 00to 1.00 and sending to server.
- https://example.com/cart?product_id=12345&price=100&price=1
- The server may consider only the second price=1and charge $1 instead of $100 for the product.
- Reusing Expired Codes: An attacker uses an expired code in the URL: https://example.com/checkout?product_id=12345&original_price=100&discount_code=SAVE50 Result: Final price is $50 instead of $100.
- Stacking Discounts: The attacker applies multiple valid discount codes: https://example.com/checkout?product_id=12345&original_price=100&discount_code=SAVE50&discount_code=SAVE30 Result: Final price is $35 instead of $100.
- Manipulating Discount Logic: The attacker modifies the discount code to 100%: https://example.com/checkout?product_id=12345&original_price=100&discount_code=SAVE100 Result: Final price is $0.
- Actual Price: A product costs $100 USD.
- Changing Currency: The user converts the currency to Indian Rupees (INR), where the price reads ₹8,000 (with an assumed conversion rate of ₹80 to 1 USD).
- Manipulating the Exchange Rate: The user finds that they can enter a custom exchange rate. They change the price to ₹1,000 (instead of the actual price).
- Completion of Transaction: The buyer makes the order, and the site takes the amount of ₹1,000 as payment for the item sold.
- An online retail shop that enables the customers to put a product into the cart and then discount it before submitting the order doesn’t check for final prices on orders submitted.
- Adding Products to Cart: A customer adds a very expensive product for $200.
- Applying Discounts: The customer can find a code that can get them a discount of 50%. Applying it, he expected the price should be $100.
- Manipulating the Cart: Before the checkout process is complete, the user rapidly manipulates the cart using browser developer tools to revert the item price back to $0 or some other significantly lower value.
- Making Multiple Requests: The user sends multiple requests to the server in rapid succession in an attempt to complete the purchase before the system processes the discount validation.
- Checkout Processing: If the server does not handle these requests properly, it might process one of the requests with the manipulated price of $0.
- the server could easily misinterpret it and thereby incur an accidental free transaction of items.
Business Logic Vulnerability: Price Manipulation Read More »