Broken Math: Exploiting Business Logic for Price Manipulation
The checkout process calculated the price in USD and then converted it to TRY, but the currency parameter could be changed to TRY before the initial calculation. After refreshing the payment page, the system treated the base price as already being in TRY, allowing the attacker to pay 1 TRY instead of 1 USD.
medium.com
Published on medium.com
While technical vulnerabilities like XSS or SQLi are popular, Business Logic Flaws are the silent killers of web applications. These bugs don’t rely on code injection; instead, they exploit the very rules the application was built on.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application trusted a client-supplied currency parameter during the initial price calculation and then performed a second conversion without validating that the base currency matched the original.
Impact
The attacker could pay a much lower amount (1 TRY instead of 1 USD), causing financial loss to the merchant.
What the attacker needed
Access to the checkout process; ability to intercept and modify requests
The fix
The vulnerability was fixed within hours, likely by validating the currency parameter server-side and preventing client-side manipulation of the base currency.
How it was found
- Intercept the request at the initial price calculation stage.
- Change the currency parameter from USD to TRY.
- Proceed to the payment page, which still shows the price in USD.
- Refresh the payment page to trigger recalculation.
- Complete the transaction at the manipulated price.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Business logic flaws are mistakes in the rules an application follows, not in its code. Here, the site let the user choose which currency the price was in, and then converted it again later. By changing the currency early and refreshing, the attacker made the site think the price was already in the cheaper currency.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.