Skip to content
Business logic Write-up Beginner

[Business Logic Error] Coupon Code Reuse and Stack leads to Buy Product for Free.

The challenge store allowed the same coupon code to be applied repeatedly and allowed several different coupons to be stacked on one order. An attacker could drive the cart total down to zero and obtain the product without paying.

Md. Hachib Kazi Follow

Published on betabyte.medium.com

Business Logic Error

Md. Hachib Kazi, on betabyte.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Intigriti's Challenge 1026, titled Halloween Store, was a web security challenge in the business logic category, created by Globules. The target was the challenge application at:

Text
https://challenge-1026.challenges.intigriti.io/challenge

The feature under test is a shopping flow: a visitor adds a product to a cart, applies coupon codes, and places an order. The challenge site advertises a coupon at the top of the page, and a second coupon can be obtained by subscribing to the newsletter. The intended behaviour of such a feature is that a coupon is applied once, and that an order carries a single discount. The challenge's flag is awarded when an order is placed successfully.

Setup

No accounts, roles, tools or versions are described beyond the challenge itself. The only preconditions are access to the challenge page and the ability to add a product to the cart, read the coupon shown at the top of the page, and subscribe to the newsletter to receive the second coupon. The author states that all testing was performed with proper authorisation on the Intigriti October 2026 CTF challenge environment and in line with the program rules.

Finding it

The author characterises the issue as a classical business logic flaw: the application does not enforce proper validation on coupon code usage. Two properties combine. First, any coupon code can be used multiple times. Second, multiple coupon codes can be used in a single order. Together these allow stacking and reuse, which drives the cart total down to zero.

The two coupons involved are:

Code Discount Source
NIGHT20 20% off The Midnight Collection Shown at the top of the challenge site (October Exclusive)
NEWS30 30% off Obtained by subscribing to the newsletter

Both codes are reusable and can be stacked.

Exploitation

Step 1: Open the challenge page

Text
https://challenge-1026.challenges.intigriti.io/

This is the entry point to the store.

Step 2: Add the product to the cart

Add The Midnight Collection pack to the cart.

The Midnight Collection Pack
The Midnight Collection Pack From the original on betabyte.medium.com

The screenshot shows The Midnight Collection Pack as the product being added.

Step 3: Collect the first coupon

Read the first coupon code, NIGHT20, from the top of the challenge page.

First coupon code
First coupon code From the original on betabyte.medium.com

The screenshot shows the first coupon code as displayed on the page.

Step 4: Collect the second coupon

Obtain the second coupon code, NEWS30, by subscribing to the newsletter.

Second Cupon Code
Second Cupon Code From the original on betabyte.medium.com

The screenshot shows the second coupon code obtained through the newsletter subscription.

Step 5: Apply each coupon twice

Use the coupon codes one by one, two times each.

Step 6: Alternate the order of application

Apply them in the sequence:

Text
NIGHT20 > NEWS30 > NIGHT20 > NEWS30

or the reverse order.

Stack the coupon code
Stack the coupon code From the original on betabyte.medium.com

The screenshot shows the coupons being stacked in the cart.

Step 7: Place the order at zero price

When the price reaches $0, place the order to get the flag.

From the original on betabyte.medium.com

The screenshot shows the order being placed once the price has dropped to zero.

The resulting flag was:

Text
INTIGRITI{094638e6-ba2f-4c50–8bb4–41ced0d5debd}
Solved Acknowledgement form Intigriti
Solved Acknowledgement form Intigriti From the original on betabyte.medium.com

The acknowledgement form confirms the solved challenge.

Root cause

The application does not enforce proper validation on coupon code usage. The report does not describe the server-side implementation, so the exact mechanism is unknown. As a result, the same code can be submitted repeatedly and different codes can be combined, each reducing the price further until it reaches zero. The report does not describe the server-side implementation, so the exact mechanism is inferred from the observed behaviour.

Impact

According to the author, this small business logic issue has a large effect on a business. It enables an attacker to:

  • Buy product for free.
  • Cause direct financial loss for the company.
  • Damage the company's product integrity.

The author also notes that business logic errors are overlooked and that automated tools or scanners cannot find this type of vulnerability.

Fix

The author recommends the following mitigations:

  • Enforce proper validation on coupon code usages.
  • Do not allow multiple coupon codes in a single order.
  • Invalidate a coupon after a single use.

The key takeaways repeat this: always invalidate a coupon code after a single use, or limit it to one use per account, and enforce single coupon use per order.

Variants to test

  • Coupon reuse on the same cart: submit the same code twice and observe whether the discount is applied twice.
  • Coupon stacking: apply two different codes to one order and check whether both discounts are reflected.
  • Order of application: alternate codes (for example A, B, A, B) and compare with applying each code consecutively.
  • Per-account limits: redeem a code on one account, then on another, to see whether the limit is per account or global.
  • Post-order reuse: place an order with a code, then start a new cart and reuse the same code.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher took part in a public online challenge called Intigriti's Challenge 1026, nicknamed Halloween Store. The challenge is a pretend online shop, built on purpose so that people can practise finding a specific kind of mistake. The mistake here is in how the shop handles discount codes, the little words you type at checkout to get money off, like a voucher you cut out of a newspaper.

The shop gives out two discount codes. One is printed at the top of the page: NIGHT20, which takes 20% off a product called The Midnight Collection. The other, NEWS30, gives 30% off and you get it by signing up to the shop's newsletter, which is just an email list.

Normally a shop should let you use a code once, and should let you use only one code per order. This shop did neither. You could type the same code in again and again, and you could mix both codes together. Each time a code was accepted, the price dropped a bit more. After applying NIGHT20, then NEWS30, then NIGHT20, then NEWS30, the price reached $0. The researcher placed the order for free, and the challenge rewarded that with a flag.

A flag is a secret string of text that proves you solved the challenge. In this case it was:

Text
INTIGRITI{094638e6-ba2f-4c50–8bb4–41ced0d5debd}
Solved Acknowledgement form Intigriti
Solved Acknowledgement form Intigriti From the original on betabyte.medium.com

The image shows the acknowledgement form on Intigriti where the solved challenge is confirmed.

This kind of mistake is called a business logic error. The word "logic" here means the rules of how a feature is supposed to work, and a logic error means the program follows the rules badly or not at all. Nothing crashes, no alarm goes off, and no security scanner will spot it, because the program is doing exactly what it was told to do. It was simply told the wrong thing.

The challenge and its target

The write-up lists the basics of the challenge:

  • Challenge: Halloween Store
  • Platform: intigriti
  • Category: Web Security / Business Logic Error
  • Vulnerability: Payment Bypass via Coupon Reuse
  • Difficulty: Medium

Intigriti is a company that runs bug bounty programmes, where organisations pay researchers to report security problems, and it also publishes these practice challenges. Challenge 1026 was created by Globules. The target application, meaning the website being tested, was:

Text
https://challenge-1026.challenges.intigriti.io/challenge

A URL like this is just an address, the same kind you type into your browser's address bar. The part challenge-1026.challenges.intigriti.io is the name of the server, and /challenge is the particular page on it.

The feature being tested

The feature is a shopping flow, the normal sequence of actions in any online shop:

  1. A visitor adds a product to a cart. The cart is a temporary list of things you intend to buy, kept by the shop while you browse.
  2. The visitor types in coupon codes, which are discount vouchers made of letters and numbers.
  3. The visitor places the order, which means confirming the purchase.

The shop advertises one coupon at the top of the page, and a second coupon can be obtained by subscribing to the newsletter. The intended behaviour, the way the shop is supposed to work, is that a coupon is applied once, and that an order carries a single discount. The challenge's flag is awarded when an order is placed successfully.

Setup

The write-up does not describe any accounts, roles, tools or software versions beyond the challenge itself. The only things needed are a browser and access to the challenge page. From there you need to be able to add a product to the cart, read the coupon shown at the top of the page, and subscribe to the newsletter to receive the second coupon.

The author states that all testing was performed with proper authorisation on the Intigriti October 2026 CTF challenge environment and in line with the program rules. Authorisation matters: testing a website you do not own or have permission to test is not acceptable, even if the testing is harmless. A CTF, short for capture the flag, is a competition where the targets are deliberately built for this purpose.

Finding it

The author calls the issue a classical business logic flaw: the application does not enforce proper validation on coupon code usage. Validation means checking that what a user submits is allowed. Here, the shop did not enforce proper validation on coupon code usage.

Two properties combine:

  1. Any coupon code can be used multiple times.
  2. Multiple coupon codes can be used in a single order.

Together these allow stacking and reuse. Stacking means piling discounts on top of each other, like stacking several vouchers on a shop counter and having the cashier accept all of them. Reuse means using the same voucher more than once. Each accepted code reduces the cart total, and the total keeps falling until it reaches zero.

The two coupons involved are:

Code Discount Source
NIGHT20 20% off The Midnight Collection Shown at the top of the challenge site (October Exclusive)
NEWS30 30% off Obtained by subscribing to the newsletter

Both codes are reusable and can be stacked.

Exploitation

Exploitation means using the flaw on purpose to get a result you should not be able to get. Here the result is a free order. The steps below follow the write-up in order.

Step 1: Open the challenge page

Text
https://challenge-1026.challenges.intigriti.io/

This is the entry point to the store, the shop's front page. Opening it is the equivalent of walking into a shop. The researcher starts here because every later action, adding to the cart and applying coupons, happens inside this shop.

Step 2: Add the product to the cart

Add The Midnight Collection pack to the cart.

The Midnight Collection Pack
The Midnight Collection Pack From the original on betabyte.medium.com

The screenshot shows The Midnight Collection Pack as the product being added. Adding it to the cart is necessary because coupons only make sense against something you are buying: the discount is calculated from the price of the items in the cart. With an empty cart there is nothing to discount.

Step 3: Collect the first coupon

Read the first coupon code, NIGHT20, from the top of the challenge page.

First coupon code
First coupon code From the original on betabyte.medium.com

The screenshot shows the first coupon code as displayed on the page. The shop itself publishes this code, so no guessing is needed. The researcher notes it down so it can be typed into the cart later.

Step 4: Collect the second coupon

Obtain the second coupon code, NEWS30, by subscribing to the newsletter.

Second Cupon Code
Second Cupon Code From the original on betabyte.medium.com

The screenshot shows the second coupon code obtained through the newsletter subscription. A newsletter is a regular email sent to people who sign up. Shops often hand out a discount in exchange for an email address, because the email list is valuable to them. Subscribing is a normal, intended action, and it is how the second code is meant to be obtained.

Step 5: Apply each coupon twice

Use the coupon codes one by one, two times each. This is the heart of the attack. A correct shop would reject the second use of the same code, or would reject the second code because one is already applied. This shop accepts both, so each submission knocks more money off the total.

Step 6: Alternate the order of application

Apply them in the sequence:

Text
NIGHT20 > NEWS30 > NIGHT20 > NEWS30

or the reverse order. The > symbols here simply mean "then": apply NIGHT20, then NEWS30, then NIGHT20 again, then NEWS30 again. The author applied the codes in this sequence, or its reverse, to reach zero. The write-up gives this sequence, or its reverse, without explaining the shop's calculation.

Stack the coupon code
Stack the coupon code From the original on betabyte.medium.com

The screenshot shows the coupons being stacked in the cart.

Step 7: Place the order at zero price

When the price reaches $0, place the order to get the flag.

From the original on betabyte.medium.com

The screenshot shows the order being placed once the price has dropped to zero. Placing the order is the final confirmation, the equivalent of handing your basket to the cashier. Because the total is now zero, no payment is needed, and the shop treats the purchase as complete. The challenge then reveals its flag:

Text
INTIGRITI{094638e6-ba2f-4c50–8bb4–41ced0d5debd}
Solved Acknowledgement form Intigriti
Solved Acknowledgement form Intigriti From the original on betabyte.medium.com

The acknowledgement form confirms the solved challenge.

Root cause

The application does not enforce proper validation on coupon code usage. In plain terms, the shop did not enforce proper validation on coupon code usage. As a result, the same code can be submitted repeatedly and different codes can be combined, each reducing the price further until it reaches zero.

The write-up does not describe the server-side implementation, meaning the code running on the shop's own computers, so the exact mechanism is inferred from the observed behaviour. That is normal in this kind of testing: you see what the shop does from the outside and reason backwards about why.

Impact

According to the author, this small business logic issue has a large effect on a business. It enables an attacker to:

  • Buy product for free.
  • Cause direct financial loss for the company.
  • Damage the company's product integrity.

Financial loss is easy to see: a product is bought for free. Product integrity means trust in the shop and its pricing: if word spreads that orders can be had for nothing, the shop's prices and promotions stop meaning anything. The author also notes that business logic errors are overlooked and that automated tools or scanners cannot find this type of vulnerability, because a scanner checks for known technical patterns, not for a rule that was never written.

Fix

The author recommends the following mitigations:

  • Enforce proper validation on coupon code usages.
  • Do not allow multiple coupon codes in a single order.
  • Invalidate a coupon after a single use.

To invalidate a coupon means to mark it as used so it can never be accepted again. The key takeaways repeat this: always invalidate a coupon code after a single use, or limit it to one use per account, and enforce single coupon use per order.

Variants to test

These are the same ideas applied to other shops, useful when you meet a similar feature elsewhere:

  • Coupon reuse on the same cart: submit the same code twice and observe whether the discount is applied twice.
  • Coupon stacking: apply two different codes to one order and check whether both discounts are reflected.
  • Order of application: alternate codes (for example A, B, A, B) and compare with applying each code consecutively.
  • Per-account limits: redeem a code on one account, then on another, to see whether the limit is per account or global.
  • Post-order reuse: place an order with a code, then start a new cart and reuse the same code.

Glossary

  • Business logic error: a flaw in the rules of how a feature is meant to work, rather than in its technical plumbing; the program runs but follows the wrong rules.
  • Payment bypass: getting past the payment step without paying, for example by making the total zero.
  • Coupon code: a short word or string of letters and numbers that gives a discount when entered at checkout.
  • Stacking: applying several discounts to the same order so that they add up.
  • Reuse: using the same coupon code more than once.
  • Cart: the temporary list of items a shopper intends to buy.
  • Order: the confirmed purchase of the items in the cart.
  • Validation: checking that what a user submits is allowed before acting on it.
  • Invalidate: to mark something, such as a coupon, as no longer usable.
  • Flag: a secret string of text that proves a challenge was solved.
  • CTF (capture the flag): a competition with deliberately built targets where solving tasks reveals flags.
  • Bug bounty programme: a scheme where organisations pay researchers for reporting security problems in their systems.
  • Intigriti: the platform that ran this challenge and runs bug bounty programmes.
  • URL: the address of a page or resource, typed into a browser's address bar.
  • Server: the computer that runs a website and answers requests from visitors' browsers.
  • Server-side: happening on the server, in code the visitor cannot see or change directly.
  • Newsletter: a regular email sent to people who sign up for it.
  • Root cause: the underlying reason a flaw exists, as opposed to its visible symptoms.
  • Impact: the harm a flaw can cause to a business or its users.
  • Mitigation: a change that removes or reduces a flaw.
  • Scanner: an automated tool that checks a website for known technical weaknesses.
  • Authorisation: permission to test a system, given by whoever owns it.
  • Exploitation: deliberately using a flaw to obtain a result that should not be possible.

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.