Skip to content
Business logic Write-up Intermediate

The Coupon That Meant Different Things to Two Functions

The coupon system validated coupon codes using Unicode normalization that mapped lookalike characters to legitimate codes, but the duplicate check compared the raw strings, so the same promotion could be added twice. An attacker could stack duplicate discounts to reduce a €666 product to €0 without spending store credit.

medium.com

Published on medium.com

Cybersecurity

Yacyn, 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.

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. 6 min read.

Context

The target is the Intigriti challenge hosted at challenge-1026.challenges.intigriti.io. It presents itself as a seasonal e-commerce site: a Halloween-themed storefront with a catalogue of sweets and gift boxes. Every new visitor is assigned €66.00 in store credit.

The page that matters is The Midnight Collection, a single limited product priced at €666.00. The gap between the starting credit and the price is deliberate. A normal customer can browse and buy smaller items, but the collector's box is out of reach. The goal of the challenge is to close that gap without altering the credit the server has stored for the session.

The obvious feature to attack is the coupon system.

From the original on medium.com

Setup

The application is easy to map from its frontend and API traffic alone, and the whole exercise was carried out against a single fresh session.

Finding it

The flow from product selection to checkout is straightforward. When a session starts, the client requests /api/session and receives the available credit. It then fetches the product catalogue and the current cart. Pressing "Add to bag" sends the selected product ID to /api/cart/items.

The cart response carries everything needed to calculate an order:

JSON
{  "subtotal": 66600,  "discount": 0,  "total": 66600,  "credit": 6600,  "canCheckout": false,  "items": []}

Amounts are in cents, so the target product is €666.00 and the starting credit is €66.00.

The cart also exposes a coupon interface. Pressing Apply sends only the coupon code:

JSON
{"code":"NIGHT20"}

The server resolves that code against its own promotion configuration and returns the resulting discount. The user never supplies the percentage or the calculated amount.

A second discount becomes available after subscribing to the newsletter. That endpoint returns NEWS30, and the cart accepts it alongside NIGHT20.

Checkout is the final step:

HTTP
POST /api/checkoutHost: challenge-1026.challenges.intigriti.ioContent-Type: application/json{}

Before approving the order, the server compares the final total with the session's credit. If the order is covered, it creates an order ID, deducts the payment from the credit balance, and places the challenge flag inside the receipt.

The two legitimate promotions are:

Text
NIGHT20 = 20%NEWS30 = 30%

Their discounts stack by adding their percentages:

Text
66600 × 20% = 1332066600 × 30% = 19980-------------------------Total discount = 33300Final total    = 33300

That leaves a €333.00 order against €66.00 of credit. The intended promotions are useful but nowhere near enough to buy the collection.

Several common techniques failed:

  • Lowercase versions and ordinary mixed-case versions were correctly rejected as duplicates.
  • Adding a percent, amount, or count field to the request had no effect.
  • Sending overlapping apply requests did not produce duplicate promotions.
  • The coupon endpoint was not vulnerable to the usual race-condition attempt.

This was not a race condition. The breakthrough came from looking at how the coupon was interpreted rather than how frequently it was submitted.

Exploitation

Coupon systems often appear to have one obvious representation of a code. In practice a request passes through several comparison points:

  1. Is this a known coupon?
  2. Is it already present in the cart?
  3. What percentage should it receive?
  4. How should it be displayed in the response?

Every one of those stages needs to agree on exactly what the submitted code means.

Step 1: Find codes that the validator accepts but the duplicate check does not

The server accepted these two requests:

JSON
{"code":"N\u0131GHT20"}
JSON
{"code":"NEW\u017f30"}

The escaped characters are not ordinary letters:

  • \u0131 is the Latin small letter dotless i.
  • \u017f is the Latin small letter long s.

Their uppercase forms are ASCII characters:

Python
>>> "NıGHT20".upper()'NIGHT20'
Python
>>> "NEWſ30".upper()'NEWS30'

The coupon validator therefore recognised them as the intended promotions. The duplicate check, however, did not see them as equivalent to the coupons already stored in the cart. Both variants were accepted as new promotions.

Step 2: Confirm the duplicate entries in the cart response

The response normalised the entries back to their ASCII names and grouped them:

JSON
{  "code": "NIGHT20",  "percent": 20,  "amount": 26640,  "count": 2}
JSON
{  "code": "NEWS30",  "percent": 30,  "amount": 39960,  "count": 2}

Each coupon had been accepted twice. The discount calculation was now adding 20% + 30% + 20% + 30% to the same €666 subtotal.

Step 3: Run the full sequence in one fresh session

One fresh session was enough. The researcher added The Midnight Collection, subscribed to the newsletter, and submitted four coupon requests in this order:

JSON
{"code":"NIGHT20"}{"code":"NEWS30"}{"code":"N\u0131GHT20"}{"code":"NEW\u017f30"}

The cart endpoint confirmed the result:

JSON
{  "subtotal": 66600,  "discount": 66600,  "total": 0,  "credit": 6600,  "canCheckout": true}

Two weaknesses became visible at once:

  1. The same promotion could be represented twice under alternate Unicode forms.
  2. The combined discount was allowed to equal the entire product price without hitting a final business-logic ceiling.

Step 4: Check out

Checkout was now trivial. The server accepted the zero-value order and returned:

JSON
{  "paid": 0,  "credit": 6600,  "flag": "INTIGRITI{094638e6-ba2f-4c50-8bb4-41ced0d5debd}"}

The collection had been purchased without spending any of the €66.00 credit.

Root cause

The bug is not in the coupon arithmetic. It lives in the definition of equality.

The evidence points to validation and duplicate detection using different normalisation contexts. The validator effectively maps the Unicode spellings onto the ASCII coupon codes, while the duplicate check compares representations that do not collide. Once the promotion is stored, the response layer maps both entries back to the same canonical code and increments count.

This maps to CWE-1289: Improper Validation of Unsafe Equivalence in Input, with CWE-840: Business Logic Errors covering the resulting discount abuse.

A secure implementation needs one canonical identifier shared by every part of the system. Sanitising the code when it is first submitted is not enough. Duplicate checks, stored records, calculations and output must all use the same canonical value.

Impact

The challenge result was a €0.00 purchase of a €666.00 product with the original credit intact. In a production shop, the same pattern could lead to:

  • Repeated promotional abuse
  • Free or underpriced orders
  • Incorrect revenue and tax calculations
  • Inventory loss
  • Fraudulent order records
  • Bypass of minimum-price requirements

These outcomes make this more than a cosmetic input-validation issue. The discount directly controls the checkout decision.

Fix

The first fix is to canonicalise coupon codes before validation and deduplication:

Python
from unicodedata import normalizedef canonical_coupon_code(code: str) -> str:    code = normalize("NFKC", code).strip().casefold()    if not code.isascii():        raise ValueError("Invalid coupon code")    return code

If coupon codes are intended to be ASCII-only, reject non-ASCII input rather than trying to translate every possible lookalike.

The server should then resolve the canonical code to a trusted internal promotion identifier:

Text
NIGHT20 → night_20NEWS30  → news_30

Every subsequent operation should use that identifier. The submitted text should never decide whether two promotions are the same.

The remaining controls should mirror the business rule:

  • Allow at most one entry per canonical promotion ID.
  • Enforce the configured usage limit atomically.
  • Ignore client-supplied discount amounts.
  • Decide server-side whether promotions may stack.
  • Apply a final maximum-discount rule.
  • Recalculate the order during checkout instead of trusting an earlier cart response.
  • Alert when count exceeds the configured limit or the total reaches zero unexpectedly.

Variants to test

  • A positive result is a cart response that shows the same canonical code with a count above one.
  • A positive result is any variant that passes validation but is stored as a separate entry from its canonical form.
  • A positive result is a duplicate entry rather than a rejection.
  • A positive result is a total of zero or below with canCheckout true.
  • A positive result is any change in the returned discount that the server did not derive from its own configuration.
  • A positive result is an order accepted at a total the server did not recompute itself.
  • A positive result is a count above the limit or a discount that keeps growing.

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. 18 min read.

What happened, in plain words

A security challenge site set up a fake online sweet shop for Halloween. Every visitor gets €66.00 of pretend store credit. There is one very expensive box of sweets, The Midnight Collection, priced at €666.00. You cannot afford it with your credit, and the challenge is to buy it anyway without changing the credit the server has written down for you.

The shop has discount coupons. One gives 20% off, another gives 30% off. Even with both, the box still costs €333.00, far more than the €66.00 you have. The trick that solved the challenge was not about sending lots of requests quickly. It was about spelling the coupon code with a strange character that looks almost like a normal letter. The part of the shop that checks whether a coupon is real said yes. The part that checks whether you already used that coupon said no, this is a different code. So the same discount got added twice, and the price fell to €0.00.

This is a beginner's walkthrough of that whole story, from opening the shop to the final receipt.

The shop and the goal

The target is the Intigriti challenge at challenge-1026.challenges.intigriti.io. The site looks like a normal seasonal e-commerce store: a Halloween-themed storefront with a catalogue of sweets and gift boxes.

Every new visitor is given €66.00 in store credit. Store credit here is pretend money held by the server, not by your browser. The server remembers how much each visitor has.

The page that matters is The Midnight Collection, a single limited product priced at €666.00. The gap between €66.00 and €666.00 is on purpose. A normal customer can browse and buy smaller items, but the collector's box is out of reach. The goal of the challenge is to close that gap without altering the credit the server has stored for the session.

From the original on medium.com

The obvious feature to attack is the coupon system. A coupon is a short code you type at checkout to get money off. If the shop gets the maths or the bookkeeping around coupons wrong, the price can drop further than intended.

Setup

The application is easy to map just by watching what the browser sends and receives, which you can do with the developer tools built into every browser (usually opened with F12). The final sequence was carried out in one fresh session. A session is one continuous visit: the server gives your browser a label so it can remember who you are between requests.

Finding it

The flow from product selection to checkout is straightforward. Here is what happens behind the page, step by step.

When a session starts, the client (your browser) requests /api/session and receives the available credit. An API is the set of addresses a website's own pages talk to in order to fetch and change data. When you click something on a modern site, the page often does not reload; it quietly sends a request to one of these addresses and draws the answer on screen. /api/session is one such address, and it answers the question "who am I and how much credit do I have?".

The client then fetches the product catalogue and the current cart. The catalogue is the list of things for sale. The cart is the basket of things you have chosen but not yet paid for.

Pressing "Add to bag" sends the selected product ID to /api/cart/items. A product ID is a short internal label for one item, so the server knows exactly which product you mean without relying on its name.

The cart response carries everything needed to calculate an order:

JSON
{  "subtotal": 66600,  "discount": 0,  "total": 66600,  "credit": 6600,  "canCheckout": false,  "items": []}

This is JSON, a common text format for data sent between a browser and a server. It is a list of labels and values inside curly braces. Line by line:

  • subtotal is the price of everything in the basket before any discount. It is 66600.
  • discount is how much money is being taken off. It is 0, so nothing yet.
  • total is what you would pay after the discount. It is 66600, the same as the subtotal because there is no discount.
  • credit is the store credit the server has recorded for you. It is 6600.
  • canCheckout is a yes/no switch telling the page whether the order is currently payable. It is false, meaning no.
  • items is the list of products in the cart. It is empty here.

Amounts are in cents, so the target product is €666.00 and the starting credit is €66.00. Storing money as whole cents avoids rounding mistakes that come from decimal fractions.

The cart also exposes a coupon interface. Pressing Apply sends only the coupon code:

JSON
{"code":"NIGHT20"}

This tiny message says: here is a coupon code, NIGHT20, please apply it. The server resolves that code against its own promotion configuration and returns the resulting discount. In other words, the server keeps a private list of which codes exist and what each is worth. The user never supplies the percentage or the calculated amount. That is good design: if the browser could say "this coupon is worth 90%", anyone could edit the message and give themselves a huge discount.

A second discount becomes available after subscribing to the newsletter. A newsletter is a regular email with shop news; subscribing is free and the shop rewards it. That endpoint returns NEWS30, and the cart accepts it alongside NIGHT20. So now you have two codes.

Checkout is the final step:

HTTP
POST /api/checkoutHost: challenge-1026.challenges.intigriti.ioContent-Type: application/json{}

This is an HTTP request, the same kind of message your browser sends every time it loads a page or submits a form. Line by line:

  • POST /api/checkout means "send data to the checkout address". POST is the method used when you are submitting something rather than just asking to view it.
  • Host: challenge-1026.challenges.intigriti.io tells the server which website the request is for. One server can host many sites, so it needs to know which one you mean.
  • Content-Type: application/json says the body of the request is in JSON format, so the server should read it that way.
  • {} is the body: an empty JSON object. Nothing extra is being sent; the server already knows your cart from your session.

Before approving the order, the server compares the final total with the session's credit. If the order is covered, it creates an order ID, deducts the payment from the credit balance, and places the challenge flag inside the receipt. A flag is a secret string that proves you solved the challenge; here it is the prize you are trying to reach.

The two legitimate promotions are:

Text
NIGHT20 = 20%NEWS30 = 30%

This just lists the two real coupons and their values: NIGHT20 takes 20% off, NEWS30 takes 30% off.

Their discounts stack by adding their percentages:

Text
66600 × 20% = 1332066600 × 30% = 19980-------------------------Total discount = 33300Final total    = 33300

Line by line:

  • 66600 × 20% = 13320 is 20% of the €666.00 subtotal, in cents.
  • 66600 × 30% = 19980 is 30% of the same subtotal, in cents.
  • The dashed line separates the working from the answer.
  • Total discount = 33300 adds the two discounts together: 13320 + 19980 = 33300 cents, or €333.00.
  • Final total = 33300 is the price after the discount: 66600 − 33300 = 33300 cents, or €333.00.

That leaves a €333.00 order against €66.00 of credit. The intended promotions are useful but nowhere near enough to buy the collection.

Several common techniques failed:

  • Lowercase versions and ordinary mixed-case versions were correctly rejected as duplicates. Writing night20 or Night20 did not fool the shop; it recognised them as the same coupon you already had.
  • Adding a percent, amount, or count field to the request had no effect. The server ignored any attempt by the browser to state its own discount.
  • Sending overlapping apply requests did not produce duplicate promotions. This is the classic race-condition idea: fire many requests at the same moment and hope the server checks before it writes. It did not work here.
  • The coupon endpoint was not vulnerable to the usual race-condition attempt.

This was not a race condition. A race condition is a bug where two actions happen at almost the same time and the system gets confused about the order, like two people grabbing the last ticket at once. The breakthrough came from looking at how the coupon was interpreted rather than how frequently it was submitted. The question changed from "how many times can I send this?" to "what exactly does the server think this code is?".

Exploitation

Coupon systems often appear to have one obvious representation of a code. In practice a request passes through several comparison points:

  1. Is this a known coupon?
  2. Is it already present in the cart?
  3. What percentage should it receive?
  4. How should it be displayed in the response?

Every one of those stages needs to agree on exactly what the submitted code means. Think of a cloakroom: the person at the door checks your ticket, the person at the rack checks whether that coat is already taken, and the person at the exit checks the ticket again. If they each read the ticket slightly differently, the same ticket can be used twice.

Step 1: Find codes that the validator accepts but the duplicate check does not

The server accepted these two requests:

JSON
{"code":"N\u0131GHT20"}
JSON
{"code":"NEW\u017f30"}

These look almost identical to the real codes, but they are not. The \u0131 and \u017f parts are escape sequences: a way of writing a character that is hard to type by giving its official number. JSON uses \u followed by four hexadecimal digits (0 to 9 and a to f) to name any character in the Unicode standard. Unicode is the giant catalogue that assigns a number to every letter and symbol in every writing system.

The escaped characters are not ordinary letters:

  • \u0131 is the Latin small letter dotless i. It looks like an i without the dot on top.
  • \u017f is the Latin small letter long s. It looks like an f without the crossbar, an old-fashioned way of writing s.

Their uppercase forms are ASCII characters:

Python
>>> "NıGHT20".upper()'NIGHT20'

This is a line typed into Python, a popular programming language, at its interactive prompt (the >>>). Line by line:

  • "NıGHT20" is the coupon code containing the dotless i.
  • .upper() asks Python to convert the text to uppercase.
  • The result shown on the next line is 'NIGHT20', the ordinary ASCII code.

ASCII is the small, old set of characters that covers plain English letters, digits and punctuation. The dotless i, when uppercased, becomes an ordinary capital I.

Python
>>> "NEWſ30".upper()'NEWS30'

Same idea with the long s:

  • "NEWſ30" is the coupon code containing the long s.
  • .upper() converts it to uppercase.
  • The result is 'NEWS30', the ordinary ASCII code.

The coupon validator therefore recognised them as the intended promotions. The validator is the part that answers question 1: is this a known coupon? It uppercased the text, the strange letters turned into ordinary ones, and it said yes.

The duplicate check, however, did not see them as equivalent to the coupons already stored in the cart. The duplicate check answers question 2: have I already got this one? It compared the raw text, where the dotless i and the long s are different characters from the ordinary i and s, and concluded these were new coupons. Both variants were accepted as new promotions.

Step 2: Confirm the duplicate entries in the cart response

The response normalised the entries back to their ASCII names and grouped them:

JSON
{  "code": "NIGHT20",  "percent": 20,  "amount": 26640,  "count": 2}
JSON
{  "code": "NEWS30",  "percent": 30,  "amount": 39960,  "count": 2}

Normalising means converting different spellings of the same thing into one standard form, the way a form might store every phone number in the same layout. Here the response layer converted the strange characters back to ordinary ASCII and grouped the entries. Line by line for the first block:

  • code is the coupon name as the shop now displays it: NIGHT20.
  • percent is the discount rate: 20%.
  • amount is the money taken off: 26640 cents, which is 20% of 66600 twice over (13320 × 2).
  • count is how many times this coupon is in the cart: 2.

And the second block:

  • code is NEWS30.
  • percent is 30%.
  • amount is 39960 cents, which is 30% of 66600 twice over (19980 × 2).
  • count is 2.

Each coupon had been accepted twice. The discount calculation was now adding 20% + 30% + 20% + 30% to the same €666 subtotal. That is 100% in total, so the price would fall to zero.

Step 3: Run the full sequence in one fresh session

One fresh session was enough. The researcher added The Midnight Collection, subscribed to the newsletter, and submitted four coupon requests in this order:

JSON
{"code":"NIGHT20"}{"code":"NEWS30"}{"code":"N\u0131GHT20"}{"code":"NEW\u017f30"}

This is four coupon requests written one after another. Line by line:

  • {"code":"NIGHT20"} applies the ordinary 20% coupon.
  • {"code":"NEWS30"} applies the ordinary 30% coupon.
  • {"code":"N\u0131GHT20"} applies the 20% coupon again, spelled with the dotless i. The validator accepts it as NIGHT20; the duplicate check treats it as new.
  • {"code":"NEW\u017f30"} applies the 30% coupon again, spelled with the long s. Same story.

The order matters only in that the ordinary versions go in first, so the strange spellings are the ones that slip past the duplicate check.

The cart endpoint confirmed the result:

JSON
{  "subtotal": 66600,  "discount": 66600,  "total": 0,  "credit": 6600,  "canCheckout": true}

Line by line:

  • subtotal is still 66600, the full price of the box.
  • discount is now 66600, the entire price.
  • total is 0, so there is nothing left to pay.
  • credit is still 6600, so none of your €66.00 has been touched.
  • canCheckout is now true, so the shop is willing to take the order.

Two weaknesses became visible at once:

  1. The same promotion could be represented twice under alternate Unicode forms. The shop had two different spellings of one coupon and treated them as two coupons.
  2. The combined discount was allowed to equal the entire product price without hitting a final business-logic ceiling. A ceiling here means a rule such as "never discount more than, say, 50% of the price". There was no such rule, so 100% was allowed.

Step 4: Check out

Checkout was now trivial. The server accepted the zero-value order and returned:

JSON
{  "paid": 0,  "credit": 6600,  "flag": "INTIGRITI{094638e6-ba2f-4c50-8bb4-41ced0d5debd}"}

Line by line:

  • paid is 0, meaning no money was taken.
  • credit is still 6600, so the €66.00 is intact.
  • flag is the challenge prize, the string that proves the box was bought.

The collection had been purchased without spending any of the €66.00 credit.

Root cause

The bug is not in the coupon arithmetic. The sums were correct: 20% plus 30% plus 20% plus 30% really is 100%. The bug lives in the definition of equality. Two pieces of the shop disagreed about whether two pieces of text were the same coupon.

The evidence points to validation and duplicate detection using different normalisation contexts. The validator effectively maps the Unicode spellings onto the ASCII coupon codes, while the duplicate check compares representations that do not collide. Once the promotion is stored, the response layer maps both entries back to the same canonical code and increments count. Canonical means the single agreed standard form of a value.

This maps to CWE-1289: Improper Validation of Unsafe Equivalence in Input, with CWE-840: Business Logic Errors covering the resulting discount abuse. CWE is a public catalogue of weakness types, each with a number, so security people can name a bug precisely. The first entry is about accepting two inputs as equivalent when that equivalence is not safe. The second is about the shop's own rules being broken rather than a technical flaw in a library.

A secure implementation needs one canonical identifier shared by every part of the system. An identifier is a label used internally to refer to something. Sanitising the code when it is first submitted is not enough. Sanitising means cleaning input, for example stripping odd characters. Duplicate checks, stored records, calculations and output must all use the same canonical value.

Impact

The challenge result was a €0.00 purchase of a €666.00 product with the original credit intact. In a production shop, the same pattern could lead to:

  • Repeated promotional abuse: using one coupon many times.
  • Free or underpriced orders: paying less than the shop intended.
  • Incorrect revenue and tax calculations: the books record money that never arrived.
  • Inventory loss: goods leave the warehouse without matching payment.
  • Fraudulent order records: orders that look legitimate but are not.
  • Bypass of minimum-price requirements: rules such as "this item never sells below €500" get ignored.

These outcomes make this more than a cosmetic input-validation issue. The discount directly controls the checkout decision. In other words, the number produced by the coupon system is the same number the shop uses to decide whether to hand over the goods.

Fix

The first fix is to canonicalise coupon codes before validation and deduplication:

Python
from unicodedata import normalizedef canonical_coupon_code(code: str) -> str:    code = normalize("NFKC", code).strip().casefold()    if not code.isascii():        raise ValueError("Invalid coupon code")    return code

This is a small Python function. Line by line:

  • from unicodedata import normalize loads a ready-made tool from Python's standard library. The library is a collection of code that comes with the language, so you do not have to write everything yourself.
  • def canonical_coupon_code(code: str) -> str: starts a function named canonical_coupon_code. It takes one input called code, which must be text (str), and promises to return text.
  • code = normalize("NFKC", code).strip().casefold() does three clean-up steps in a row. normalize("NFKC", code) rewrites the text into a standard form, so lookalike characters are converted to their ordinary equivalents. .strip() removes spaces at the start and end. .casefold() converts to a standard lowercase form, a stricter version of lowercasing designed for comparisons.
  • if not code.isascii(): checks whether anything non-ASCII survived the clean-up.
  • raise ValueError("Invalid coupon code") stops with an error if it did. Rejecting is safer than guessing.
  • return code hands back the cleaned, standard code.

If coupon codes are intended to be ASCII-only, reject non-ASCII input rather than trying to translate every possible lookalike. There are many characters that resemble ordinary letters, and chasing them one by one is a losing game.

The server should then resolve the canonical code to a trusted internal promotion identifier:

Text
NIGHT20 → night_20NEWS30  → news_30

This shows a lookup table. The text the customer typed, NIGHT20, is turned into an internal label, night_20. The text NEWS30 becomes news_30. The arrow means "maps to". Every subsequent operation should use that identifier. The submitted text should never decide whether two promotions are the same; only the internal label should.

The remaining controls should mirror the business rule:

  • Allow at most one entry per canonical promotion ID. One coupon, one slot in the cart.
  • Enforce the configured usage limit atomically. Atomically means as a single indivisible step, so two requests arriving together cannot both slip past the check.
  • Ignore client-supplied discount amounts. The browser must never be able to state its own discount.
  • Decide server-side whether promotions may stack. Stacking means combining several coupons on one order; the shop, not the customer, should decide if that is allowed.
  • Apply a final maximum-discount rule. A hard ceiling, for example "no order may be discounted by more than 50%".
  • Recalculate the order during checkout instead of trusting an earlier cart response. The cart response is only a preview; the checkout must do its own maths.
  • Alert when count exceeds the configured limit or the total reaches zero unexpectedly. An alert tells the shop's operators that something odd is happening, even if the request was accepted.

Variants to test

Each one lists what a positive result looks like, so you know when you have found something.

  • A positive result is a cart response that shows the same canonical code with a count above one.
  • These are different standard ways of encoding the same visible text; combining marks are extra characters that attach to a letter, such as an accent. A positive result is any variant that passes validation but is stored as a separate entry from its canonical form.
  • A zero-width character is an invisible character that takes up no space on screen. A positive result is a duplicate entry rather than a rejection.
  • A positive result is a total of zero or below with canCheckout true.
  • A positive result is any change in the returned discount that the server did not derive from its own configuration.
  • Replaying means sending an old saved message again as if it were new. A positive result is an order accepted at a total the server did not recompute itself.
  • Sequentially means one after another; concurrently means at the same time. A positive result is a count above the limit or a discount that keeps growing.

Glossary

  • API: the set of addresses a website's pages use to fetch and change data behind the scenes.
  • ASCII: the basic set of characters covering plain English letters, digits and punctuation.
  • Atomic: done as one indivisible step, so two simultaneous actions cannot both pass a check.
  • Business logic: the shop's own rules, such as how much a coupon is worth or when an order may be placed.
  • Canonical: the single agreed standard form of a value, used so every part of a system compares the same thing.
  • Cart: the basket of products chosen but not yet paid for.
  • Casefold: a stricter form of lowercasing designed for comparing text reliably.
  • Checkout: the final step where an order is confirmed and paid for.
  • Client: the browser (or app) making requests to a server.
  • Concurrent: happening at the same time.
  • Coupon: a short code that gives money off an order.
  • CWE: a public catalogue of weakness types, each with a number, used to name security bugs precisely.
  • Duplicate check: the part of a system that decides whether an item is already present.
  • Escape sequence: a way of writing a character by its official number, such as \u0131 in JSON.
  • Flag: a secret string that proves a challenge was solved.
  • Function: a named block of code that takes input and returns a result.
  • Host header: the part of an HTTP request that says which website the request is for.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • Identifier: a label used internally to refer to something, such as a product or a promotion.
  • JSON: a common text format for structured data, made of labels and values in curly braces.
  • Library: a collection of ready-made code that comes with a programming language.
  • Normalisation: converting different spellings of the same thing into one standard form.
  • POST: the HTTP method used when submitting data rather than just viewing a page.
  • Product ID: a short internal label for one product.
  • Race condition: a bug where two actions happening at almost the same time confuse the system.
  • Replay: sending an old saved message again as if it were new.
  • Sanitise: clean input, for example by removing unexpected characters.
  • Sequential: one after another.
  • Server: the computer that holds the shop's data and answers the browser's requests.
  • Session: one continuous visit, tracked by the server so it remembers who you are.
  • Stacking: combining several discounts on one order.
  • Store credit: pretend money held by the server that a visitor can spend in the shop.
  • Subtotal: the price of everything in the basket before any discount.
  • Unicode: the standard catalogue that assigns a number to every letter and symbol in every writing system.
  • Validator: the part of a system that checks whether an input is acceptable.
  • Zero-width character: an invisible character that takes up no space on screen.

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.