Skip to content
Business logic Write-up Beginner

Business Logic Bug — Bypassing Gift Card Limits Using a Single

A gift card could be reused multiple times and the per-order limit was enforced via a client-modifiable parameter, allowing a single low-value gift card to be applied more than the allowed maximum. An attacker could obtain a larger discount than intended by reusing one gift card and tampering with the remaining-count value.

rootxjeet Follow

Published on medium.com

Most people think hacking is about complex payloads, heavy scripts, or finding some crazy technical vulnerability. But sometimes, the biggest issues hide in simple business logic mistakes.

rootxJeet, 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 did not track gift card usage or enforce the maximum limit on the backend, instead trusting a client-supplied value for the remaining gift card count.

Impact

An attacker could reuse a single gift card to obtain a larger discount than intended and bypass the per-order limit, potentially reducing the price of a product significantly.

What the attacker needed

A user account; ability to purchase a gift card; ability to intercept and modify requests

The fix

The server should track gift card usage on the backend, validate the gift card ID, and enforce the maximum limit server-side rather than trusting a client-modifiable parameter.

How it was found

  1. Buy a low-value gift card and add a product to the cart.
  2. Apply the same gift card multiple times during checkout; each application adds a discount.
  3. Intercept the request when applying the gift card that would exceed the limit.
  4. Modify the remaining gift cards value in the request to allow one more.
  5. Forward the request and observe that the extra gift card is accepted.

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.

A business logic bug is when a website's own rules are not enforced properly, so you can do things the designers did not intend. Here, a gift card that should work only once kept working, and the number of gift cards allowed per order could be changed by the user. This meant a small gift card could be used many times to reduce the price more than it should.

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.

More by rootxjeet

View all

1 more disclosed report, best first.

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.