Skip to content
Business logic Write-up Beginner

Exploiting Promo Code Flaw Abusing Codes To Buy Items For Free

The promo code verification only checked the numeric part of a code, leaving a fixed alphabetic prefix, so an attacker could brute-force the numeric portion to find valid codes. This allowed products to be purchased for free by reducing the payment amount to zero.

Jeewan Bhatta Follow

Published on infosecwriteups.com

In the world of online shopping, promo codes are a popular method for consumers to access discounts, special offers, and free products. However, when the security behind these promo codes is compromised, it can lead to major vulnerabilities, resulting in significant financial loss for businesses.

Jeewan Bhatta, on infosecwriteups.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 promo code validation only checked the numeric portion of the code and did not enforce rate limiting, allowing brute-force enumeration of valid codes.

Impact

Attackers could obtain products for free by brute-forcing promo codes, causing financial loss to the business.

What the attacker needed

Access to the store's API; ability to send HTTP requests

The fix

The promo code system should be fixed by implementing proper validation of the entire code and rate-limiting to prevent brute-force attacks.

How it was found

  1. Send a POST request to the promo code redemption endpoint with a promo code in the body.
  2. Use a tool like Burp Suite Intruder to iterate through possible numeric values for the promo code.
  3. Identify successful responses (200 status) indicating valid promo codes.
  4. Apply the valid promo code to reduce the payment amount to zero and obtain products for free.

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.

Promo codes are like secret words that give you a discount. Here, the system only checked the numbers part of the code and ignored the letters, so someone could guess many number combinations until they found a working code. That let them get items without paying.

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 Jeewan Bhatta

View all

10 more disclosed reports, 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.