How I Exploited a Coupon Logic Flaw to Get €674.90
The application allowed two promotional codes to be applied repeatedly by alternating between them, so each discount was counted twice. An attacker could reduce a €674.90 cart to €0.00 and complete checkout without paying.
medium.com
Published on medium.com
Bug Bounty
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.
Context
This write-up covers Intigriti's October 2026 Challenge (#1026), a deliberately vulnerable, authorised training application. The target was a Halloween-themed online store hosted at:
https://challenge-1026.challenges.intigriti.io/store

The store behaves like a normal e-commerce application: it has a product catalogue, a cart, promotional coupon codes, a store credit balance and a checkout flow. The researcher set out to buy an expensive product without having enough credit, using only the application's own purchasing workflow.
Three parts of the store matter for the rest of the article:
- Store credit. The account had a fixed balance of €66.00. Any item costing more than that could not be bought unless its price was legitimately reduced within the challenge's rules.
- The target product. Under the Gift Boxes section there was a product called The Midnight Collection, priced at €666.00, with the description One box. Made only once.
- A discount mechanism. The store offered promotional codes, which made the coupon workflow the natural place to investigate.

Setup
No special tooling is described. The preconditions were simply the challenge account with its €66.00 store credit and the two promotional codes that the store itself advertised or handed out.
Finding it
The approach was to understand the intended purchasing workflow before trying to manipulate anything. Two promotional codes were discovered during reconnaissance.
Coupon 1: NIGHT20
The announcement banner displayed the following promotion:

This coupon works only on The Midnight Collection product and provides a 20% discount.

Coupon 2: NEWS30
Further down the page there was an October Newsletter subscription form.

After entering a test email address and subscribing, the application displayed a confirmation message containing the welcome code NEWS30. This code provided a 30% discount.
Applied once each, the two promotions give a combined discount of 50% under the challenge's discount calculation. That is not enough to bring a €666.00 item within a €66.00 balance, so the interesting question was how the application handled repeated coupon applications.
The Midnight Collection was added to the cart and the cart opened at:
https://challenge-1026.challenges.intigriti.io/cart

At this point the application correctly prevented checkout because the available credit was insufficient.
Applying NIGHT20 reduced the total, and applying NEWS30 reduced it further. The interesting behaviour appeared when a coupon was reused: the application appeared to restrict immediately repeating the same code. That observation suggested testing a different sequence, alternating between the two available coupons instead of submitting the same one consecutively.
Exploitation
Step 1: Apply NIGHT20
The first coupon was applied to the cart, which reduced the total as advertised.
Step 2: Apply NEWS30
The second coupon was applied on top, reducing the total further.
Step 3: Apply NIGHT20 again
The application appeared to restrict immediately repeating the same code, but after NEWS30 had been submitted in between, NIGHT20 was accepted again.
Step 4: Apply NEWS30 again
Submitting NEWS30 once more, again separated from its previous use by the other code, was also accepted.

The cart was observed after each application. The application allowed the discounts to accumulate instead of consistently enforcing the intended coupon usage rules, and eventually each coupon was reflected twice in the order summary.
The displayed discount calculation was:
| Promotion | Discount calculation |
|---|---|
NIGHT20 |
20% × 2 |
NEWS30 |
30% × 2 |
| Total | 100% total discount |
Final payable amount: €0.00.
With the total at zero, the checkout button changed from the disabled Still needed state to an active Complete order button. The checkout was completed and the application displayed an order confirmation indicating that the order had been paid for with €0.00 in store credit.

The challenge returned the following flag:
INTIGRITI{094638e6-ba2f-4c50–8bb4–41ced0d5debd}
Root cause
The application did not correctly enforce the discount rules across repeated coupon applications. It appeared to restrict only the immediate repetition of the same code, so interleaving a second code between two uses of the first was accepted. Each coupon then counted twice in the order summary and the discounts accumulated to 100%.
The exact internal implementation was not visible from client-side behaviour alone. The issue could involve coupon deduplication, cart state transitions or discount recalculation. What is certain from the outside is the observable result: the intended per-coupon usage limit was not enforced across the whole cart lifecycle.
Impact
In this challenge the impact was a cart worth €674.90 reduced to €0.00, which allowed the order to be completed for €0.00 in store credit and produced the challenge flag. The researcher is explicit that this demonstrates the behaviour of the challenge application and is not a claim about a real store or production transaction.
Fix
The report lists the following developer guidance:
- Enforce coupon limits: track applied coupons server-side and prevent unintended reuse.
- Define stacking rules: explicitly control which promotions can be combined and enforce discount caps.
- Recalculate prices server-side: validate product prices, coupon eligibility, store credit and the final payable amount.
- Validate checkout: confirm that the final order total follows the business rules before processing an order.
- Test edge cases: test repeated coupons, alternating codes, different application orders and cart updates.
The report does not say what, if anything, was changed in the challenge application itself.
Variants to test
- Alternating two codes. Apply code A, then code B, then A again, then B again, and watch the order summary after each step. A positive result is each coupon appearing more than once, or the total dropping below what a single application of each should produce.
- Reordering the sequence. Try B then A then B then A, and try three or more codes in rotation.
- Cart state transitions. Add or remove items, change quantities, or reload the cart between coupon applications.
- Discount caps. Stack enough promotions to exceed 100% and see whether the total is clamped at zero or goes negative.
- Server-side recalculation. Replay the checkout request with the coupon list from the manipulated cart and compare the returned total with the one the server computes independently.
Lessons
The report closes with a short set of habits for hunters: understand the workflow before testing, test sequences rather than single actions, monitor state changes after each action, document observed behaviour without guessing the backend, and demonstrate impact through the final calculation or checkout. The core lesson is to test how features interact, not just each feature on its own.
What happened, in plain words
A security researcher took part in a public challenge run by Intigriti, a company that runs bug bounty programmes. In these challenges, a company builds a small website on purpose with a mistake in it, and anyone can try to find and use that mistake. It is a safe place to practise, because the site is meant to be attacked.
The challenge site was a pretend Halloween sweet shop. You could browse products, put them in a shopping basket (called a cart), and pay with a fake balance of store credit. The aim was to buy an expensive product called The Midnight Collection, which cost €666.00, while your account only held €66.00.
The shop had two coupon codes. One gave 20% off, the other 30% off. Used once each, that is 50% off, which still leaves €333.00 to pay, far more than €66.00. But the shop had a flaw: it appeared to stop you using the same coupon twice in a row. If you used coupon A, then coupon B, then coupon A again, the shop accepted A a second time. Doing that with both coupons meant each discount was counted twice, 20% + 20% + 30% + 30%, which adds up to 100%. The final payable amount was €0.00, the order went through, and the challenge gave back a secret code (a flag) proving it had been solved.
This article walks through the same steps the researcher took, explaining each idea from scratch.
1. Reconnaissance: exploring the Halloween store
Reconnaissance simply means looking around a website before touching anything, the way you might walk around a shop to see where the tills, the exits and the special offers are. The researcher's first step was to explore the shop and understand how a normal purchase was supposed to work, before trying to bend any rules.
The challenge was hosted at:
https://challenge-1026.challenges.intigriti.io/store

That address is a URL. The part after https:// is the domain name, which is like the street address of the shop. The /store at the end points to a particular page on that site, much like a named department inside a building. The image above shows the Halloween-themed store front page.
Three details stood out straight away.
Store credit: €66.00. Your account had a fixed balance of €66.00. Store credit is money the shop already holds for you; you can spend it but you cannot top it up here. This mattered because it set a hard ceiling: anything costing more than €66.00 could not be bought unless its price was legitimately brought down using the shop's own rules.
The target product: The Midnight Collection. Under a section called Gift Boxes there was a special product priced at €666.00. Its description read:
One box. Made only once.
That price was far beyond the available credit, which is exactly why it was the target.
A discount mechanism. The shop offered promotional codes, also called coupons. A coupon is a short code you type at checkout to reduce the price. Because the goal involved lowering a price, the coupon feature was the obvious place to look.
Rather than immediately tampering with anything, the researcher first explored how the shop expected a customer to apply discounts and go through checkout. This is a key habit: learn the normal path first, so you can recognise what is abnormal later.
2. Finding the promotional codes
During this look around, two promotional codes turned up.
Coupon 1: NIGHT20
The announcement banner displayed the following promotion:

A banner is the wide strip near the top of a page used for announcements. This one advertised a code called NIGHT20. The code works only on The Midnight Collection product and gives a 20% discount.

The image above shows the NIGHT20 code being used to take 20% off The Midnight Collection.
Coupon 2: NEWS30
Further down the page there was an October Newsletter subscription form.

A newsletter subscription form is a small box where you type your email address to receive marketing emails. Shops often reward new subscribers with a welcome discount, and that is what happened here. After entering a test email address and subscribing, the application displayed a confirmation message containing the welcome code NEWS30. This code provided a 30% discount.
Used once each, the two promotions give a combined discount of 50% under the challenge's discount calculation. Fifty percent off €666.00 still leaves €333.00, which is far above the €66.00 balance. So the interesting question became: how does the shop handle using a coupon more than once?
The Midnight Collection was added to the cart and the cart opened at:
https://challenge-1026.challenges.intigriti.io/cart

A cart is the holding area for items you intend to buy, like a physical basket in a shop. The /cart page is where you review what is in it and apply discounts. The image above shows the cart after NIGHT20 had been applied, with the total reduced.
At this point the application correctly prevented checkout because the available credit was insufficient. In other words, the shop refused to let the order go through, which is the sensible behaviour.
Applying NIGHT20 reduced the total, and applying NEWS30 reduced it further. The interesting behaviour appeared when a coupon was reused: the application appeared to restrict immediately repeating the same code. That is, if you typed the same code twice in a row, the second attempt appeared to be restricted. That observation suggested testing a different sequence: alternating between the two available coupons instead of submitting the same one consecutively.
3. Understanding the cart workflow
Before exploiting anything, it helps to picture the normal flow, because the flaw lives in that flow. A workflow is simply the sequence of steps a user goes through to complete a task. Here the workflow is: browse, add to cart, apply a coupon, apply another coupon, check the total, then check out.
A business logic flaw is a mistake not in the code's syntax but in the rules the code enforces. The program runs fine; it just allows something the business never intended. A useful comparison is a ticket machine that correctly checks you have paid, but forgets to check you only bought one ticket, so you can collect several. Nothing crashes; the rule is simply missing or incomplete.
The question was whether the shop actually enforced that rule across the whole cart, or only in a narrow way.
4. The business logic flaw: alternating coupon codes
The key test was to alternate between the two promotional codes instead of submitting the same code consecutively.

The image above shows the alternating coupons being accepted.
The sequence was:
- Apply
NIGHT20 - Apply
NEWS30 - Apply
NIGHT20again. - Apply
NEWS30again.
The cart was observed after each application. Watching the total after every single step is important, because it shows exactly when the shop stops behaving as expected. The application allowed the discounts to accumulate instead of consistently enforcing the intended coupon usage rules, and eventually each coupon was reflected twice in the order summary.
An order summary is the panel that lists what you are buying, the discounts applied, and the final amount due. Seeing each coupon listed twice there is the visible proof of the flaw.
The displayed discount calculation was:
| Promotion | Discount calculation |
|---|---|
NIGHT20 |
20% × 2 |
NEWS30 |
30% × 2 |
| Total | 100% total discount |
Final payable amount: €0.00.
The arithmetic is simple: 20% twice is 40%, 30% twice is 60%, and 40% + 60% = 100%. A 100% discount means nothing is left to pay.
5. Exploitation: turning €674.90 into €0.00
With the total at zero, the checkout button changed from the disabled Still needed state to an active Complete order button. A disabled button is one you can see but cannot click; the shop greys it out while you still owe money. Once the balance reached zero, the button became clickable.
The checkout was completed and the application displayed an order confirmation indicating that the order had been paid for with €0.00 in store credit.

The image above shows the order confirmation after checkout.
The challenge returned the following flag:
INTIGRITI{094638e6-ba2f-4c50–8bb4–41ced0d5debd}
A flag is a unique string of characters that a challenge hands you once you have solved it. It is like a receipt proving you completed the task; you submit it to the challenge platform to claim the points. The INTIGRITI{...} wrapper is just a label marking it as an Intigriti flag.
Why it worked (root cause)
The application did not correctly enforce the discount rules across repeated coupon applications. It appeared to restrict only the immediate repetition of the same code, so interleaving a second code between two uses of the first was accepted. Each coupon then counted twice in the order summary and the discounts accumulated to 100%.
Deduplication means removing duplicates, in this case refusing to count the same coupon more than once. Slip a different coupon in between, and the check was fooled.
The exact internal implementation was not visible from client-side behaviour alone. Client-side means what happens in your browser; server-side means what happens on the shop's own computers. The researcher could only see the browser's side, so the precise cause could involve coupon deduplication, cart state transitions or discount recalculation. What is certain from the outside is the observable result: the intended per-coupon usage limit was not enforced across the whole cart lifecycle.
Impact
In this challenge the impact was a cart worth €674.90 reduced to €0.00, which allowed the order to be completed for €0.00 in store credit and produced the challenge flag. The researcher is explicit that this demonstrates the behaviour of the challenge application and is not a claim about a real store or production transaction.
How to fix it
The report lists the following developer guidance:
- Enforce coupon limits: track applied coupons server-side and prevent unintended reuse.
- Define stacking rules: explicitly control which promotions can be combined and enforce discount caps.
- Recalculate prices server-side: validate product prices, coupon eligibility, store credit and the final payable amount.
- Validate checkout: confirm that the final order total follows the business rules before processing an order.
- Test edge cases: test repeated coupons, alternating codes, different application orders and cart updates.
Stacking means combining several discounts on one order. Edge cases are unusual but valid situations, such as using the same coupon twice or applying them in a strange order. The report does not say what, if anything, was changed in the challenge application itself.
Variants to test
If you ever meet a similar shop, these are the kinds of things worth trying. Each is described with what a positive result looks like.
- Alternating two codes. Apply code A, then code B, then A again, then B again, and watch the order summary after each step. A positive result is each coupon appearing more than once, or the total dropping below what a single application of each should produce.
- Reordering the sequence. Try B then A then B then A, and try three or more codes in rotation.
- Cart state transitions. Add or remove items, change quantities, or reload the cart between coupon applications.
- Discount caps. Stack enough promotions to exceed 100% and see whether the total is clamped at zero or goes negative.
- Server-side recalculation. Replay the checkout request with the coupon list from the manipulated cart and compare the returned total with the one the server computes independently.
Lessons
The report closes with a short set of habits for hunters: understand the workflow before testing, test sequences rather than single actions, monitor state changes after each action, document observed behaviour without guessing the backend, and demonstrate impact through the final calculation or checkout. The core lesson is to test how features interact, not just each feature on its own.
Glossary
- Bug bounty: a programme where companies pay people to find and report security mistakes in their systems.
- Challenge: a deliberately vulnerable practice website built so people can safely try to break it.
- Reconnaissance: looking around a website to understand how it works before testing anything.
- URL: the address of a page on the web, such as
https://example.com/store. - Domain name: the part of a URL that identifies the website, like a street address.
- Store credit: a balance of money held by a shop that you can spend on purchases.
- Coupon / promotional code: a short code entered at checkout to reduce the price.
- Banner: a wide strip near the top of a page used for announcements.
- Newsletter subscription form: a box where you enter an email address to receive marketing emails.
- Cart: the holding area for items you intend to buy.
- Workflow: the sequence of steps a user goes through to complete a task.
- Business logic flaw: a mistake in the rules an application enforces, rather than in its code syntax.
- Order summary: the panel listing items, discounts and the final amount due.
- Disabled button: a button that is visible but cannot be clicked.
- Flag: a unique string a challenge gives you once you have solved it, proving completion.
- Deduplication: removing duplicates, such as refusing to count the same coupon more than once.
- Client-side: what happens in your browser.
- Server-side: what happens on the website's own computers.
- Stacking: combining several discounts on a single order.
- Edge case: an unusual but valid situation, such as using the same coupon twice.
- Root cause: the underlying reason a flaw exists.
- Impact: the real-world consequence of a flaw, such as getting goods for free.
- CWE: a catalogue of common weakness types used to classify security flaws.