Skip to content
Business logic Write-up Beginner

Server-Side Discount Validation Bypass Enables Arbitrary Price Reduction

The order-creation endpoint accepted a client-supplied discount amount without server-side validation, so the discount value could be changed to any figure. An attacker could therefore reduce the price of an order by an arbitrary amount.

ali3bdelhady Follow

Published on medium.com

I started exploring the website and understanding its functionality “lets say it is example.com” It is an online store so when I saw the discount option with a promo code I decided to check how the application handled input values on the server side

Ali Abdelhady, on medium.com

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 server trusted the discount amount supplied in the order request instead of recalculating it from the promo code on its own side.

What the attacker needed

A promo code; ability to intercept requests

How it was found

  1. Browse the online store and find the promo code discount option.
  2. Capture the order-creation request in an intercepting proxy.
  3. Notice the request body contains a discounts array with an amount field.
  4. Change the amount value to a larger number and resend the request.
  5. Observe that the larger discount is applied and appears in the confirmation email.

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.

When you buy something online, the shop's server should decide how much a promo code is worth. Here the server trusted a number sent by the browser instead of checking it itself, so anyone could edit that number and pay less. This is called a server-side validation problem: the server must never trust values the user can change.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.