Easy Logic Bugs: How I Bypassed Two “Unbypassable” Checks in Production Systems
Two business logic flaws were found: an e-commerce discount rule was only enforced by a client-side dialog, so navigating directly to checkout kept the discount on a single item; and a hotel booking cancellation endpoint checked ownership but not whether the specific booking was still cancellable, allowing a non-cancelable booking to be cancelled by swapping the booking identifier.
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
Two business logic flaws in production systems, both disclosed through the applications' normal flows and both patched. The target names are withheld in the write-up; what follows is the mechanics.
The first is an e-commerce platform running an opt-in "extra deals" campaign: a 20% discount gated behind a rule of a minimum of 2 items and a minimum total of €69. The second is a hotel booking platform whose cancellation API accepts a booking identifier inside a URL parameter and does not re-validate that the specific booking is still eligible for cancellation.
Neither bug required an exotic payload. Both came down to a rule that was enforced where the user usually interacts with it rather than where the system commits to it.

Setup
For the e-commerce case the only precondition was an account able to opt into the campaign and a cart. The researcher added a single qualifying item priced at €99.99, which is above the €69 total threshold but below the 2-item minimum, so the cart was deliberately in a state that should not qualify.
For the booking case the precondition was one account holding two bookings:
- Booking A, eligible for cancellation.
- Booking B, explicitly not eligible: the deadline had passed and the booking was flagged as non-cancelable.
The second bug required modifying the cancellation request in flight. No versions or product names are given.
Finding it
The e-commerce platform did show a check. Attempting to check out below the minimum produced a dialog:
"Below minimum amount, Shop minimum 2 items for minimum 69 € to use the extra deals voucher. By continuing to checkout the discount will be deactivated."
Clicking "Continue" removed the discount and the total returned to full price. The rule appeared to be enforced as designed.

The observation that broke it open was that the deactivation was not enforced, it was performed: the logic lived entirely behind the dialog's "Continue" button, a client-side action. That raised the obvious question of what happens when the button is never clicked.
For the booking platform the starting point was the shape of the cancellation call itself:
POST /api/.../cancelBooking?url=.../bookings/cancellation/[BOOKING_ID]
A standard authenticated cancellation request with the booking ID embedded in a URL parameter. The identifier is supplied by the client and the endpoint is the thing that actually changes state, which is exactly where eligibility should be re-checked.
Exploitation
Bug 1, step 1: build a non-qualifying cart
Add one qualifying item to the cart, a €99.99 item. One item is below the 2-item minimum, so the campaign rule should not apply.
Bug 1, step 2: opt into the campaign
The cart confirms: "Your discounts are active." The 20% discount is now attached to the cart state.
Bug 1, step 3: skip the dialog
Instead of clicking Checkout from the cart, type the checkout URL directly into the browser.

No dialog appeared and no check ran. The checkout page loaded fully order-ready, with the billing form, delivery options and payment selection present, and the 20% discount still applied to the single item. €99.99 became €79.99.
The discounted total was not a UI artefact: it was baked into the server-side checkout session and survived full page reloads. Any path that skipped the dialog, whether a bookmarked URL, a typed address or a browser autofill suggestion, skipped the rule entirely.
Bug 2, step 1: start a legitimate cancellation
Start a cancellation for Booking A, the eligible one, and intercept the request.
Bug 2, step 2: swap the identifier
Replace [BOOKING_A] with [BOOKING_B]. Nothing else changes: same session, same authentication, same everything.
Bug 2, step 3: forward the request
The response came back as:
{"status":"Cancelled Booking"}
Checking the booking record afterwards confirmed a real state change rather than a cosmetic message:
"status": "Cancelled Booking","non_cancelable": true
A booking explicitly marked non-cancelable had been cancelled. The endpoint checked whether the user owned a booking, but never re-checked whether this specific booking was eligible for cancellation at that moment.
Root cause
Both bugs share one pattern: a rule was enforced at the point where the user usually interacts with it, not at the point where the system actually commits to it.
On the e-commerce side, campaign eligibility was enforced reactively, triggered by a specific client-side interaction (the dialog's Continue button), instead of being validated structurally every time the checkout state was built. The server built the checkout session with the discount still applied, because eligibility was not validated structurally when that state was built.
On the booking side, cancellation eligibility was enforced implicitly during the normal cancel flow, not inside the endpoint that performs the cancellation. The ownership check passed, and the state check that actually mattered was never run. The write-up calls this IDOR-meets-business-logic: the authorization question "is this your booking?" was answered, while "is this booking in a cancellable state right now?" was not asked.
Both failed because the rule was enforced where the user usually interacts with it, not where the system commits to it. Developers test the happy path, and the happy path is exactly where the validation looks like it is working.
Impact
For the e-commerce platform, a customer could obtain the 20% campaign discount on a cart that did not meet the campaign conditions, and the discounted total persisted in the server-side checkout session across reloads, and it survived full page reloads. The write-up rates this Medium.
For the booking platform, an authenticated user could cancel a booking that was explicitly flagged non-cancelable, with a real integrity impact on the booking record. The write-up rates this Medium as well, noting low complexity and no user interaction required.
Both impacts are bounded by what the write-up states: a discount on one's own cart, and a state change on a booking under one's own account. No cross-account impact is described.
Fix
Both issues were patched through the applications' normal flows. The recommendation given for the e-commerce platform was to validate campaign eligibility server-side at checkout construction, and again at order placement, based on actual cart state (item count and total) rather than on which button the user happened to click. For the booking endpoint, the equivalent is to re-validate the specific booking's eligibility inside the cancellation handler itself, before committing the state change.
The general rule from the write-up: for anything with conditional pricing, cancellation windows or eligibility gates, ask whether the check is re-evaluated every time the server constructs the relevant state (checkout, booking status, order), or whether it only fires in response to one specific client action. If it is the second, the bug class above applies.
Variants to test
- Skip the confirmation dialog. Find any flow where a rule is announced in a modal and enforced by its Continue button, then reach the next server-side step by typing or bookmarking the URL. A positive result is a fully rendered next step with the restricted state still applied, surviving a reload.
- Swap identifiers in state-changing calls. Take a legitimate request against an object you own and substitute the identifier of another object you own that is in a different state (expired, locked, already used). A positive result is a success response plus a changed record, as with the
non_cancelablebooking above. - Replay after the window closes. Capture a valid request made while an object was still eligible, let the deadline pass, and replay it. A positive result is the same success response after eligibility should have lapsed.
- Reach the commit endpoint directly. Enumerate the step after each client-side gate (checkout, confirmation, payment selection) and request it without the preceding interaction. A positive result is a server-built state that includes the benefit the gate was meant to remove.
- Check persistence of the benefit. After any suspected bypass, reload and re-enter the flow. A positive result is the discount or status surviving, which shows it lives in server-side state rather than in the page.
What happened, in plain words
Two online services had a rule that looked like it was being enforced, but was not. In both cases the rule was checked in the wrong place: at the spot where a normal user happens to click, rather than at the spot where the server actually does the thing that matters.
- On a shopping site, a 20% discount was meant to be available only if your cart had at least 2 items and cost at least €69. The site showed a warning and removed the discount when you tried to check out with too little. But the removal only happened if you clicked the warning's button. If you reached the checkout page another way, the discount stayed.
- On a hotel booking site, a booking that was explicitly marked as not cancellable could still be cancelled. The cancellation request carried a booking number in its address, and the server checked that the booking belonged to you, but never checked that this particular booking was still allowed to be cancelled.
Neither bug needed clever attack code. Both came down to a rule that was enforced where the user usually interacts with it, not where the system commits to it.

Before the details, a few ideas that come up throughout, explained from scratch.
- Server and client. The server is the computer that owns the data: your cart, your bookings, your account. The client is your browser, the program on your own machine. Your browser can ask the server to do things, and the server decides whether to agree. A rule that only exists in the browser is a rule the browser can simply not follow.
- Business logic. The rules a business runs on, as opposed to the technical plumbing. "Two items minimum for this discount" and "this booking can no longer be cancelled" are business rules. A business logic flaw is when the software lets someone do something the business rules forbid, even though nothing technical is broken.
- API. A way for one program to talk to another over the network, usually by sending a request to a web address and getting data back. Think of it as the service counter at the back of the shop: your browser walks up to it with a request, and the server behind the counter does the work. Many web pages are really just a friendly front end that calls an API behind the scenes.
- Endpoint. One specific address on that API that does one specific job, for example "cancel a booking".
- Request and response. A request is the message your browser sends ("please cancel booking 123"). A response is the message the server sends back ("done", or an error).
- URL parameter. Extra information stuck onto the end of a web address after a
?, in the formname=value. It is just text in the address, and the browser sends whatever is there. - Session and cookie. A session is the server's memory of who you are while you are logged in. A cookie is a small piece of text your browser stores and sends back with every request so the server can recognise the session. Think of a cloakroom ticket: you show it, and the attendant knows which coat is yours.
- Authentication and authorization. Authentication is proving who you are (logging in). Authorization is deciding what you are allowed to do once you are known. The booking bug is an authorization problem.
- IDOR. "Insecure Direct Object Reference": the server takes an identifier from the client (a booking number, an order number) and acts on it without checking that this client is allowed to act on that particular object. If the server only checks "is this yours?" and not "is this one allowed right now?", you get the second bug below.
- Intercepting proxy. A tool that sits between your browser and the server and lets you pause a request, edit it, and then send it on. Like intercepting a letter at the post office, changing one word, and posting it again.
- Client-side and server-side. Client-side means the work happens in your browser. Server-side means it happens on the server. Client-side checks are for convenience; server-side checks are the ones that actually protect anything.
- State. The stored situation of something: a cart's contents, a booking's status. A state change is when that stored situation is altered, for example a booking going from active to cancelled.
- Happy path. The route a normal user takes through a feature, clicking the buttons in the intended order. Developers test this route, which is exactly where checks look like they work.
Setup
For the shopping case the only precondition was an account that could opt into the campaign, plus a cart. The researcher added a single qualifying item priced at €99.99. That is above the €69 total threshold but below the 2-item minimum, so the cart was deliberately in a state that should not qualify. One item is below the 2-item minimum, so the cart should not qualify.
For the booking case the precondition was one account holding two bookings:
- Booking A, eligible for cancellation.
- Booking B, explicitly not eligible: the deadline had passed and the booking was flagged as non-cancelable.
Both bookings were under one account.
The second bug required modifying the cancellation request while in flight. No versions or product names are given.
Finding it
The shopping platform did show a check. Attempting to check out below the minimum produced a dialog:
"Below minimum amount, Shop minimum 2 items for minimum 69 € to use the extra deals voucher. By continuing to checkout the discount will be deactivated."
Clicking "Continue" removed the discount and the total returned to full price. The rule appeared to be enforced as designed.

The observation that broke it open was that the deactivation was not enforced, it was performed: the logic lived entirely behind the dialog's "Continue" button, a client-side action. In other words, the browser was doing the rule-keeping, not the server. That raised the obvious question of what happens when the button is never clicked. If the only thing that removes the discount is a click in your own browser, then any route to the checkout page that avoids that click should arrive with the discount intact.
For the booking platform the starting point was the shape of the cancellation call itself:
POST /api/.../cancelBooking?url=.../bookings/cancellation/[BOOKING_ID]
Line by line:
POSTis the type of request. It means "please change something on the server", as opposed toGET, which just asks to read something. Cancelling a booking is a change, so it is aPOST./api/.../cancelBookingis the endpoint: the address of the job "cancel a booking". The...stands for parts of the path the write-up does not show.?url=.../bookings/cancellation/[BOOKING_ID]is a URL parameter namedurl. Its value is a path that ends in a booking identifier, shown as the placeholder[BOOKING_ID]. The real request would carry an actual booking number there.- The important detail is that the identifier is supplied by the client. Your browser puts it in the address, so your browser can put a different one there.
This is a standard authenticated cancellation request, with the booking ID embedded in a URL parameter. The identifier is supplied by the client and the endpoint is the thing that actually changes state, which is exactly where eligibility should be re-checked. If the server trusts the number in the address without asking "is this booking allowed to be cancelled right now?", the client is effectively deciding.
Exploitation
Bug 1, step 1: build a non-qualifying cart
Add one qualifying item to the cart, a €99.99 item. One item is below the 2-item minimum, so the campaign rule should not apply. This step exists to create the exact situation the rule is meant to block, so that any discount that survives is proof of the flaw.
Bug 1, step 2: opt into the campaign
The cart confirms: "Your discounts are active." The 20% discount is now attached to the cart state. Opting in is a normal, allowed action; the problem is not how the discount gets attached, but what happens (or does not happen) when the cart fails the conditions.
Bug 1, step 3: skip the dialog
Instead of clicking Checkout from the cart, type the checkout URL directly into the browser.

No dialog appeared and no check ran. The checkout page loaded fully order-ready, with the billing form, delivery options and payment selection present, and the 20% discount still applied to the single item. €99.99 became €79.99.
The discounted total was not a UI artefact: it was baked into the server-side checkout session and survived full page reloads. That last point is the proof. If the discount were only a display trick in the page, reloading would wipe it. Because it survived a reload, the server itself was holding a checkout with the discount applied. Any path that skipped the dialog, whether a bookmarked URL, a typed address or a browser autofill suggestion, skipped the rule entirely.
Bug 2, step 1: start a legitimate cancellation
Start a cancellation for Booking A, the eligible one, and intercept the request. Starting with a legitimate action matters: the request is one the server is supposed to accept, so it shows you exactly what a valid cancellation looks like, including the session and authentication that come with it.
Bug 2, step 2: swap the identifier
Replace [BOOKING_A] with [BOOKING_B]. Nothing else changes: same session, same authentication, same everything. The only edit is the booking number in the address. This is the whole attack: if the server re-checked the state of the booking named in the request, it would refuse. If it only checked that the booking belongs to you, it would accept.
Bug 2, step 3: forward the request
The response came back as:
{"status":"Cancelled Booking"}
This is JSON, a common text format for data exchanged between programs. Reading it:
- The outer braces
{and}wrap a single object, a set of name-and-value pairs. "status"is the name of the field, and"Cancelled Booking"is its value. The server is saying the booking is now cancelled.
A success message alone is not proof, though; servers sometimes say things that are not true. So the booking record was checked afterwards:
"status": "Cancelled Booking","non_cancelable": true
Line by line:
"status": "Cancelled Booking"shows the stored status of the booking is now cancelled."non_cancelable": trueshows the same record still carries the flag saying it must not be cancelled. Both facts sit side by side: the booking was marked as not cancellable, and it was cancelled anyway.
This confirmed a real state change rather than a cosmetic message. A booking explicitly marked non-cancelable had been cancelled. The endpoint checked whether the user owned a booking, but never re-checked whether this specific booking was eligible for cancellation at that moment.
Root cause
Both bugs share one pattern: a rule was enforced at the point where the user usually interacts with it, not at the point where the system actually commits to it.
On the shopping side, campaign eligibility was enforced reactively, triggered by a specific client-side interaction (the dialog's Continue button), instead of being validated structurally every time the checkout state was built. The server built the checkout session with the discount still applied, because eligibility was not validated structurally when that state was built. "Reactively" here means the check only fires in response to one particular event; "structurally" means the check is part of building the thing itself, so it cannot be skipped.
On the booking side, cancellation eligibility was enforced implicitly during the normal cancel flow, not inside the endpoint that performs the cancellation. The ownership check passed, and the state check that actually mattered was never run. The write-up calls this IDOR-meets-business-logic: the authorization question "is this your booking?" was answered, while "is this booking in a cancellable state right now?" was not asked.
Both failed because the rule was enforced where the user usually interacts with it, not where the system commits to it. Developers test the happy path, and the happy path is exactly where the validation looks like it is working.
Impact
For the shopping platform, a customer could obtain the 20% campaign discount on a cart that did not meet the campaign conditions, and the discounted total persisted in the server-side checkout session across reloads, and it survived full page reloads. The write-up rates this Medium.
For the booking platform, an authenticated user could cancel a booking that was explicitly flagged non-cancelable, with a real integrity impact on the booking record. The write-up rates this Medium as well, noting low complexity and no user interaction required.
Both impacts are bounded by what the write-up states: a discount on one's own cart, and a state change on a booking under one's own account. No cross-account impact is described.
Fix
Both issues were patched through the applications' normal flows. The recommendation given for the shopping platform was to validate campaign eligibility server-side at checkout construction, and again at order placement, based on actual cart state (item count and total) rather than on which button the user happened to click. For the booking endpoint, the equivalent is to re-validate the specific booking's eligibility inside the cancellation handler itself, before committing the state change.
The general rule from the write-up: for anything with conditional pricing, cancellation windows or eligibility gates, ask whether the check is re-evaluated every time the server constructs the relevant state (checkout, booking status, order), or whether it only fires in response to one specific client action. If it is the second, the bug class above applies.
Variants to test
- Skip the confirmation dialog. Find any flow where a rule is announced in a modal and enforced by its Continue button, then reach the next server-side step by typing or bookmarking the URL. A positive result is a fully rendered next step with the restricted state still applied, surviving a reload.
- Swap identifiers in state-changing calls. Take a legitimate request against an object you own and substitute the identifier of another object you own that is in a different state (expired, locked, already used). A positive result is a success response plus a changed record, as with the
non_cancelablebooking above. - Replay after the window closes. Capture a valid request made while an object was still eligible, let the deadline pass, and replay it. A positive result is the same success response after eligibility should have lapsed.
- Reach the commit endpoint directly. Enumerate the step after each client-side gate (checkout, confirmation, payment selection) and request it without the preceding interaction. A positive result is a server-built state that includes the benefit the gate was meant to remove.
- Check persistence of the benefit. After any suspected bypass, reload and re-enter the flow. A positive result is the discount or status surviving, which shows it lives in server-side state rather than in the page.
Glossary
- API: a way for programs to talk to each other over a network, usually by sending requests to web addresses and receiving data back.
- Authentication: proving who you are, typically by logging in.
- Authorization: deciding what a known user is allowed to do.
- Business logic: the rules a business runs on, such as minimum order sizes or cancellation deadlines.
- Business logic flaw: software letting someone do something the business rules forbid, without any technical component being broken.
- Client: the program on your own machine, here the browser.
- Client-side: happening in your browser rather than on the server.
- Cookie: a small piece of text your browser stores and sends with requests so the server can recognise your session.
- Endpoint: one specific address on an API that performs one specific job.
- Happy path: the intended route a normal user takes through a feature, clicking the buttons in order.
- IDOR (Insecure Direct Object Reference): the server acting on an identifier supplied by the client without checking that this client may act on that particular object.
- Intercepting proxy: a tool that sits between browser and server, letting you pause, edit and resend requests.
- JSON: a plain-text format for structured data, made of names and values in braces.
- POST: a request type meaning "change something on the server".
- Request: the message your browser sends to a server.
- Response: the message the server sends back.
- Server: the computer that owns the data and decides what to allow.
- Server-side: happening on the server, where the user cannot directly alter it.
- Session: the server's memory of who you are while logged in.
- State: the stored situation of something, such as a cart's contents or a booking's status.
- State change: an alteration of that stored situation.
- URL parameter: extra information appended to a web address after a
?, in the formname=value.