The Authorization Check That Only Fired When You Asked It To
A payment processor's recurring-billing endpoint only checked card ownership when the client supplied a user identifier in the request body, so omitting that parameter skipped the check and forwarded a charge against another user's saved card. An attacker with a free account could charge strangers' cards and use timing and error-message differences to enumerate live cards.
Published on medium.com
Cybersecurity
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
The target was a payment processor, reachable through the main product's single sign-on, that ran its own authorization logic on money-moving endpoints. The researcher does not name the program. The feature at the centre of the finding is recurring billing: a `POST /recurring` endpoint that, given an OAuth access token and a `payment_id`, charges the saved card behind that `payment_id`.
The report frames the target class rather than the specific company: a branded payment service, reachable through the main product's SSO, running its own authorization logic on money-moving endpoints. That description, the author notes, fits fintech, SaaS billing, marketplaces and subscription products generally.
The short version, in the author's words: the endpoint checked whether you owned a saved credit card only if you told it whose card it was. Leave that one parameter out and the check never ran, and the endpoint forwarded a charge against a stranger's card to the real payment network.
## Setup
Before sending a single request to a billing endpoint, the researcher mapped how identity flows through the estate. Recon surfaced the following:
- The checkout on the main site (`shop.example.com`) routed through a cart host (`cart.example.com`) and finally to the payment host (`pay.example.com`).
- All three shared a single OAuth SSO provider (`sso.example.com`), with the same session cookie across them.
- The processor's money endpoints authenticated with OAuth access tokens issued by that SSO.
Two further observations shaped the hunt:
1. Registration had no CAPTCHA, so a valid, authenticated account could be created programmatically in about two seconds. The barrier to becoming an authenticated user was zero, which matters because "you must be logged in" bugs are often dismissed as low impact until you point out that being logged in costs nothing.
2. The OAuth flow used the implicit grant (`response_type=token`), handing the access token back in the URL. The author filed this away; it becomes a second bug later.
The conceptual flow at this stage:
```text
anonymous ──register (no captcha)──▶ authenticated userauthenticated user ──OAuth implicit flow──▶ access_tokenaccess_token ──▶ payment endpoints
```
No vulnerability had been found yet, but the researcher knew exactly which token authorised money operations and that obtaining it was free.
## Finding it
The obvious IDOR question for `POST /recurring` is whether it checks that the card behind `payment_id` belongs to the caller. The interesting part is how the check was wired. There was an ownership check in the code, but it compared the token's user against a `website_user_id` value taken from the request body. The value it validated against was supplied by the client.
That produced two code paths, with the client choosing which one ran:
```text
POST /recurring (website_user_id present) → compare my_user_id vs website_user_id → mismatch → BLOCKED �
```
```text
POST /recurring (website_user_id omitted) → nothing to compare against → check skipped → charge forwarded ❌
```
This is not "no authorization check". A tester doing a quick pass sees the check fire when they tamper with `website_user_id`, concludes ownership is enforced, and moves on. The check exists; it just is not mandatory. Authorization was conditional on the attacker choosing to submit the evidence against themselves, which an attacker simply will not do.
The correct design derives the user's identity from the token, server-side, and validates that against the card's real owner regardless of what the client sends. This endpoint trusted a body parameter for an authorization decision.
## Exploitation
### Step 1: Register and obtain a token
Registration had no CAPTCHA, so an authenticated account could be created programmatically in about two seconds. A token was then pulled through the OAuth implicit flow (`response_type=token`), which returns the access token in the URL.
### Step 2: Send a charge with the ownership parameter omitted
With a token in hand, the researcher pointed `POST /recurring` at a `payment_id` belonging to someone else, omitting `website_user_id`. The response was:
```json
{ "result": "error", "transaction_successful": false, "internal_error": false, "message": "Transaction declined" }
```
`transaction_successful: false` reads like a dead end. The important field is `internal_error: false`: the application did not reject the request, something downstream declined it. The charge left the building.
The decline was mundane. The only `payment_id` values available at that point came from records that were already charged-back or expired. A dead card declines at the processor, but the processor is who declined it, which means the request against a stranger's card was accepted by the application, packaged, and sent to the real payment network. The only thing between the researcher and a successful unauthorised charge was the state of the card being pointed at.
### Step 3: Prove the charge left the application with a timing oracle
An application-level rejection and a real network round-trip to an external processor take very different amounts of time. Local validation of a parameter is a few database reads, sub-second. Opening a connection to an external payment gateway, sending a charge and waiting for a verdict takes seconds. The researcher measured every application-level outcome at roughly half a second:
| Request | Response | Time | `internal_error` |
|---|---|---|---|
| `payment_id` nonexistent | "Some error occurred" | ~0.5s |, |
| `payment_id` with no card | "Creditcard ID required" | ~0.5s | true |
| `payment_id` with incomplete card | "Creditcard #NN has no info" | ~0.5s | true |
| `payment_id` with expired card | "card is expired" | ~0.6s | true |
| `amount=0` / `amount=-1` | "Positive price required" | ~0.5s | true |
| `payment_id` valid + active card | charge sent to processor | 2.5-5s | false |
The valid-card path took five to ten times longer than every local rejection and was the only path with `internal_error: false`. Local validation clusters at ~0.5s; anything that has to phone the payment network sits at 2.5-5s, with no overlap. A charge attempt landing in the slow bucket with `internal_error: false` is a request that physically left the application and got a verdict from the real gateway.
### Step 4: Turn the error classes into an enumeration oracle
The `payment_id` values used above came from a sibling endpoint, `/refund`, which returned transaction records with no authentication at all: cardholder names, user IDs, payment IDs. That is its own report and not the point here; the point is what `/recurring` did with those IDs.
Each distinct state of a `payment_id` produced a distinct error message:
- nonexistent → one message
- exists but no card → another
- card incomplete → another (this one leaked an internal database record ID)
- card expired → another
- card active → the slow "declined" path
Five differentiable responses make an oracle. With no rate limiting, iterating `payment_id` sequentially lets the server sort every ID in the system into a bucket: does not exist, no card, broken card, dead card, live card. The entire payment database can be mapped and every chargeable target pre-selected before firing a single real charge.
### Step 5: Escalate from theoretical to proven
The initial report was scored High. A theoretical IDOR ("the check can be bypassed") and a proven one ("I moved money across users") are graded differently, so the escalation demonstrated the full chain end to end:
1. Register a fresh account (free, no CAPTCHA).
2. Pull a token via the OAuth implicit flow.
3. Point `/recurring` at a card that was actually live, with `website_user_id` omitted.
4. Get back `transaction_successful: true`, a brand-new payment record, and a `net_usd_equivalent` that went negative, meaning the processor fee exceeded the charge. A negative net only happens if a real fee was really assessed by a real network; that number is a receipt.
That single successful cross-user charge took the finding from "can be bypassed in theory" to "an attacker with a free account moved money out of a stranger's card".
The proof was performed against another user's real card. The program's response was clear: refund it, and for any future proof of concept use your own accounts and your own cards. The author states the boundary plainly: you almost never need someone else's card to prove a payment IDOR. Register two accounts you control, save a card to account B, and charge B's card from account A's token with the ownership parameter omitted. Same proof, same severity bump, zero collateral. If the only way to demonstrate impact is by touching a real victim, stop and talk to the program first; a good triager will often set up a test account for exactly this.
### Step 6: The OAuth chain as a second escalation
The implicit flow noted during recon turned into a second escalation stacking three classic OAuth mistakes:
- **`redirect_uri` path not validated.** The provider checked the domain but not the path. Any path on the trusted domain was accepted as a redirect target, so a token could be delivered to an arbitrary page.
- **Token in the query string, not the fragment.** The implicit grant put `access_token` in `?access_token=...`. RFC 6749 §4.2.2 mandates the URL fragment (`#`) precisely because query strings get logged server-side, swept up by analytics and tag managers, saved in browser history, and can leak via `Referer`. Query-string token delivery is a token-disclosure bug by construction.
- **Silent auto-approval.** With an existing session (a very long-lived cookie), the authorization completed with no consent screen: two server-side redirects and the token was issued.
Chained, a victim logged into any property in the ecosystem clicks one link, the flow auto-approves, and their own token lands somewhere it can be read. The attacker then does not even need their own account; they act as the victim, and the charge logs show the charge was authorised by the victim's session.
The program partially disputed this leg, because it depended on being able to place content on the trusted domain, which was not independently proven, and tracked the `redirect_uri` handling separately. The author accepts that as a fair call: not every link in a chain will be accepted, and the advice is to report the chain, let the program score the parts it can verify, and not die on the hill of the parts you cannot.
## Root cause
The authorization bug: identity for an authorization decision was read from a client-supplied body parameter, `website_user_id`. The ownership check compared the token's user against that value, so omitting the parameter left nothing to compare against and the check was skipped. The correct design derives identity from the token server-side and validates ownership unconditionally, ignoring any client-sent user id.
Supporting weaknesses that made the finding worse and easier to exploit:
- **The enumeration oracle:** distinct error messages per back-end state let the server classify every `payment_id` for the attacker.
- **No rate limiting** on a money endpoint.
- **The unauthenticated data endpoint** (`/refund`) that fed IDs into the attack.
- **The OAuth issues:** domain-only `redirect_uri` validation, query-string token delivery, no consent screen with an existing session, and long-lived cookies.
Existing defences did not stop the attack because the ownership check was present but conditional: it fired only when the client volunteered the value it was compared against. The generic "Transaction declined" message looked like a rejection but came from the downstream processor, not the application, and the timing difference between local validation and a real processor round-trip was the only reliable signal of what had actually happened.
## Impact
An attacker with a free, programmatically created account could obtain an OAuth access token and charge saved cards belonging to other users through `POST /recurring`, with the charge forwarded to the real payment network. The researcher demonstrated this end to end with a live card, receiving `transaction_successful: true`, a new payment record, and a negative `net_usd_equivalent` showing a real processor fee had been assessed.
The enumeration oracle, combined with the absence of rate limiting, allowed mapping of the payment database and pre-selection of every chargeable target before firing a real charge. The unauthenticated `/refund` endpoint supplied the payment IDs, along with cardholder names and user IDs.
The OAuth chain, had it been accepted in full, would have removed the need for an attacker account entirely: a logged-in victim clicking one link would have had their own token delivered to a readable location, with charges logged as authorised by the victim's session. The program partially disputed this leg because placing content on the trusted domain was not independently proven.
The initial report was scored High; the escalation was aimed at demonstrating the impact that would justify a higher rating. The author states a bounty of $5,000.
## Fix
When the fix shipped, it closed the chain in several places at once: the ID source was removed, the endpoint began requiring real client credentials, and a guessable default secret was rotated out. The author describes it as a layered fix for a layered bug.
The recommended fixes, stated in the report:
- **The authorization bug:** derive identity from the token server-side and validate ownership unconditionally, ignoring any client-sent user id.
- **The enumeration oracle:** return one identical generic error for every failure mode.
- **No rate limiting:** rate-limit the money endpoint.
- **The unauthenticated data endpoint:** authenticate it (it was ultimately taken offline).
- **The OAuth issues:** exact-match `redirect_uri`, fragment-only token delivery, a real consent screen, and proper cookie flags.
## Variants to test
The report distils its method into a repeatable loop. Applied to other targets:
1. **Draw the trust diagram.** Map every host, every handoff, and which token authorises what. A positive result is being able to draw who-trusts-whom from memory before testing; if you cannot, you are not ready to test authorization.
2. **Find the cheapest path to "authenticated".** Registration without a CAPTCHA is a force multiplier: it turns "requires an account" from a mitigation into a nuisance. A positive result is creating a valid account programmatically in seconds.
3. **Enumerate the money verbs.** `/refund`, `/recurring`, `/capture`, `/subscribe`, `/void`. Each is a separate code path with its own authorization story. A positive result is finding a verb whose authorization behaves differently from its siblings.
4. **For every object reference, ask two questions, not one:** is there an ownership check, and can I make it not run? Omit the parameter, send it empty, send it twice, change the content-type. A positive result is a request that reaches the sensitive action with the guard absent, for example a charge forwarded when the ownership parameter is omitted.
5. **When the app hides the outcome, measure the physics.** Timing differentials and error-class differentials reveal states the words will not. A positive result is a clear timing cliff between local rejections and requests that reach a downstream system, with no overlap between the buckets. The same trick detects blind SSRF, external webhook calls, back-end database queries versus cache hits, and any "did this actually reach the downstream system?" question.
6. **Build the end-to-end proof inside accounts you own.** Two accounts, your own cards, full chain, receipts. A positive result is `transaction_successful: true` and a new payment record against a card you control.
7. **Report the whole chain and accept partial credit gracefully.** Let the triager score what they can verify.
One further lesson from the hunt concerns automation. The program flagged thousands of automated requests from a single IP and issued a formal warning that high-volume automated scanning violated its rules, with a repeat able to damage future reports; it let the matter slide that time because the finding mattered. The author's conclusion is that a harness must be surgical: measure timing on a handful of targeted requests instead of blasting thousands, respect rate limits, read a program's rules before running, and know the difference between enumerating carefully within scope and hammering the target. Restraint, in that framing, is a feature to engineer in rather than a mood.## What happened, in plain words
A company that processes card payments had a feature for charging a saved card again and again, the way a subscription works. The feature was reachable through the company's main login system, so anyone with an account on the main product could talk to it.
The feature had a rule that was supposed to stop you charging someone else's card. The rule was written in a strange way: the server only checked who owned the card if the person sending the request also told the server whose card it was. If you simply left that piece of information out, the server had nothing to compare against, so it skipped the check and passed the charge on to the real card network.
The researcher who found this did not name the company. What the write-up is really about is two skills: noticing a bug when the server never actually says "you are not allowed", and proving the bug is real without doing anything that gets you thrown off the program. The finding was reported, the company paid a bounty of $5,000, and the researcher demonstrated a real charge against a live card to escalate the impact.
This article walks through the whole thing from zero. If you have never done security work, that is fine. Every term is explained the first time it appears, and there is a glossary at the end.
## Part 1: The mindset, or why look here at all
Most people hunting for bugs on a big website spend their time on the main product: the login page, the profile page, the thing the company advertises. That is also where everyone else is looking, which is why the easy bugs there are already gone.
The researcher looks instead at the **seams**: the places where one system hands work off to another. A seam is like the join between two pipes. Each pipe may be sound on its own, but the joint is where leaks happen.
Payment processors are described in the report as the richest seam there is, for three reasons:
1. They are often a **separate service on a separate hostname**, bolted onto the main app through single sign-on. A hostname is the part of a web address after the `https://`, such as `pay.example.com`. Single sign-on, usually shortened to **SSO**, means one login works across several different systems. So the payment service is different software, built by a different team, and often much older and less carefully maintained than the shiny frontend.
2. The main app's login session and the payment processor's permission checks are **glued together with tokens**. A **token** is a short string of characters that stands in for your identity, like a cloakroom ticket: you show the ticket, you get the coat, and the attendant does not need to know your name. Glue is where permission logic gets fuzzy, because whoever wired the two systems together had to decide "who is this user and what may they touch", and that decision is often made in a hurry in a place no designer is looking at.
3. Money endpoints have **verbs that do not exist elsewhere**: `/refund`, `/recurring`, `/capture`, `/void`, `/subscribe`. A **verb** here means the action part of a web address. An **endpoint** is a specific address on a server that does one job, like a service counter in a large building: you go to the counter for refunds, a different counter for new charges. Each verb is a separate piece of code, and separate pieces of code are where permission checks get applied inconsistently.
So the target was not "a payment site for a particular industry". The target class was: a branded payment service, reachable through the main product's SSO, running its own permission logic on endpoints that move money. That description fits a huge number of companies: fintech, software billing, marketplaces, anything with subscriptions.
**Lesson one:** do not hunt applications, hunt handoffs. Ask "where does system A trust system B, and who decided what that trust means?"
## Part 2: Mapping the permission surface before touching a money endpoint
Before sending a single request to a billing endpoint, the researcher mapped how identity flows through the whole setup. This is the part people skip, and it is the part that makes the actual bug obvious later.
Here is what the reconnaissance surfaced. **Reconnaissance**, or recon, means the information-gathering phase: looking at how a system is put together before you try anything.
- The checkout on the main site (`shop.example.com`) routed through a cart host (`cart.example.com`) and finally to the payment host (`pay.example.com`).
- All three shared a single OAuth SSO provider (`sso.example.com`), with the same session cookie across them. A **cookie** is a small piece of data your browser stores for a website and sends back with every request, which is how a site remembers that you are logged in. **OAuth** is a standard way for one system to grant another system permission on your behalf, without handing over your password.
- The processor's money endpoints authenticated with OAuth access tokens issued by that SSO. To **authenticate** means to prove who you are. An **access token** is the cloakroom ticket that proves it.
Two further observations shaped the whole hunt.
**Registration had no CAPTCHA.** A CAPTCHA is the puzzle with distorted letters or traffic lights that websites use to tell humans from programs. With no CAPTCHA, a valid, logged-in account could be created by a program in about two seconds. That matters enormously, because a lot of bugs described as "you must be logged in" get dismissed as low impact until you point out that being logged in costs nothing. It is the difference between a locked door and a door with a sign saying "please knock first".
**The OAuth flow used the implicit grant** (`response_type=token`), handing the access token back in the URL. A **grant** in OAuth is the recipe used to hand out a token. The implicit grant is an older recipe that puts the token directly into the web address the browser is sent to. The researcher filed that away; it becomes a second, nastier bug later.
At this point the picture was, conceptually:
```text
anonymous ──register (no captcha)──▶ authenticated userauthenticated user ──OAuth implicit flow──▶ access_tokenaccess_token ──▶ payment endpoints
```
Read that diagram left to right. An anonymous visitor registers, with no CAPTCHA in the way, and becomes an authenticated user. That user goes through the OAuth implicit flow and receives an access token. The access token is then what the payment endpoints accept. The arrows are handoffs, and each handoff is a place where trust is being passed along.
No vulnerability had been found yet. But the researcher now knew exactly which token authorised money operations, and knew that getting one was free.
**Lesson two:** recon is not collecting subdomains. Recon is being able to draw the trust diagram from memory. If you cannot draw who-trusts-whom on a napkin, you are not ready to test permissions.
## Part 3: The finding, a check that runs only when you volunteer the evidence against yourself
The processor had a `POST /recurring` endpoint. `POST` is one of the standard ways a browser or program talks to a server: it means "here is some data, please act on it". Given a token and a `payment_id`, the endpoint charged the saved card behind that `payment_id`. A **parameter** is a named piece of data sent with a request, like a field on a form. `payment_id` is the name of the parameter that identifies which saved card to charge. This is normal recurring billing, the machinery behind a subscription.
The obvious question, for a class of bug called **IDOR**, is whether the endpoint checks that the card behind `payment_id` belongs to the caller. IDOR stands for Insecure Direct Object Reference: it means the server lets you name an object, such as a record or a card, by its identifier, and does not check that the object is yours. The everyday comparison is a hotel where room keys are numbered 101, 102, 103: if the key for room 101 also opens room 102, that is an IDOR.
The interesting part is **how** the check was wired. There was an ownership check in the code, but it compared the token's user against a `website_user_id` value taken from the request body. The **request body** is the part of the request that carries the data, as opposed to the address or the headers. So the value the server validated against was supplied by the client, meaning by whoever sent the request.
That produced two code paths, and the client chose which one ran:
```text
POST /recurring (website_user_id present) → compare my_user_id vs website_user_id → mismatch → BLOCKED �
```
Line by line: the request goes to the `/recurring` endpoint. This time the sender includes `website_user_id`, the parameter naming whose card it is. The server compares the user identity from the token (`my_user_id`) against the value in the body (`website_user_id`). They do not match, because the sender is naming someone else's card. The request is blocked. The tick means this is the behaviour you would want.
```text
POST /recurring (website_user_id omitted) → nothing to compare against → check skipped → charge forwarded ❌
```
Line by line: the same request goes to the same endpoint, but this time `website_user_id` is simply left out. The server has nothing to compare against, so the check is skipped. The charge is forwarded to the payment network. The cross means this is the bug.
This is not "no permission check". A tester doing a quick pass sees the check fire when they tamper with `website_user_id`, concludes ownership is enforced, and moves on. The check exists; it just is not mandatory. Permission was conditional on the attacker choosing to submit the evidence against themselves, which an attacker simply will not do. It is like a bouncer who only checks your ID if you offer it.
The correct design derives the user's identity from the token, on the server side, and validates that against the card's real owner regardless of what the client sends. This endpoint trusted a body parameter for a permission decision. That is the root cause in one sentence, and it is a shape you will see again and again once you know it.
**Lesson three:** "the check fired when I tampered" is not the same as "the check is enforced". Always ask: can I make the check not run at all? Omitting a parameter, sending it empty, sending it twice, changing the content-type (the label that says what format the body is in) can each route you into a different branch of the code where the guard simply is not present.
## Part 4: The problem, the server never tells you that you succeeded
Here is the wall. When the researcher sent a charge against someone else's `payment_id` with `website_user_id` omitted, the response was:
```json
{ "result": "error", "transaction_successful": false, "internal_error": false, "message": "Transaction declined" }
```
Line by line: the response is a small block of data in **JSON**, a common text format for structured data, where names and values are paired up. `result` is `error`, so the overall outcome is an error. `transaction_successful` is `false`, so no money moved. `internal_error` is `false`, which is the crucial field and we will come back to it. `message` is `Transaction declined`, a human-readable note.
`transaction_successful: false` reads like a dead end: declined, nothing happened, move on. But look closer at `internal_error: false`. The application did not reject this request. Something downstream declined it. The charge left the building. "Downstream" means further along the chain, in this case the real card network that the payment processor talks to.
The decline was mundane. The only `payment_id` values available at that point came from records that were already charged-back or expired. A **chargeback** is when a cardholder disputes a payment and the money is pulled back. A dead card declines at the processor, but the processor is who declined it, which means the request against a stranger's card was accepted by the application, packaged, and sent to the real payment network. The only thing between the researcher and a successful unauthorised charge was the state of the card being pointed at.
So how do you prove a request reached an external payment processor when the app will not say so? You stop reading the words in the response and start reading the physics.
## Part 5: The star technique, a timing oracle that proves the charge left the app
This is the single most transferable idea in the whole report, so it is worth being explicit about it.
An application-level rejection and a real network round-trip to an external processor take very different amounts of time. A **round-trip** is one request going out and one answer coming back. The app validating a parameter locally is a few database reads, well under a second. The app opening a connection to an external payment gateway, sending a charge, and waiting for a verdict takes seconds. That gap is not noise. It is a signal you can measure, and it is very hard for a triager to argue with. A **triager** is the person at the bug bounty platform or the company who reads reports and decides whether they are valid and how serious.
Every application-level outcome resolved in roughly half a second:
| Request | Response | Time | `internal_error` |
|---|---|---|---|
| `payment_id` nonexistent | "Some error occurred" | ~0.5s |, |
| `payment_id` with no card | "Creditcard ID required" | ~0.5s | true |
| `payment_id` with incomplete card | "Creditcard #NN has no info" | ~0.5s | true |
| `payment_id` with expired card | "card is expired" | ~0.6s | true |
| `amount=0` / `amount=-1` | "Positive price required" | ~0.5s | true |
| `payment_id` valid + active card | charge sent to processor | 2.5-5s | false |
The table has four columns. The first is what was sent: an identifier for a card that does not exist, one that exists but has no card attached, one with an incomplete card, one with an expired card, an amount of zero or minus one, and finally a valid card that is still active. The second column is what came back. The third is how long it took. The fourth is the value of `internal_error`.
The valid-card path took five to ten times longer than every local rejection, and it was the only path with `internal_error: false`. Local validation clusters at about half a second; anything that has to phone the payment network sits at 2.5 to 5 seconds, with no overlap. A charge attempt landing in the slow bucket with `internal_error: false` is a request that physically left the application and got a verdict from the real gateway. A **gateway** here just means the payment network's entry point.
An **oracle** in security means any way of asking a system a question it does not intend to answer, and getting a usable answer back. The everyday comparison is a doctor tapping your knee: they are not asking your knee anything, but the reflex tells them something. Here the oracle is time: the clock tells you whether the request went out to the real world.
**Technique lesson:** response timing is evidence. When an app hides the outcome behind a generic message, latency often cannot lie, because a local error and an external round-trip live in different time zones. Build timing into your tooling and compare the numbers, do not eyeball them. The same trick detects blind SSRF, external webhook calls, back-end database queries versus cache hits, and any "did this actually reach the downstream system?" question. **SSRF** means server-side request forgery: tricking a server into making a request on your behalf. A **webhook** is an automatic message one system sends to another when something happens.
## Part 6: The enumeration oracle, five error classes are five bits of leaked truth
The `payment_id` values used above came from somewhere. They came from a sibling endpoint, `/refund`, which returned transaction records with no authentication at all: cardholder names, user IDs, payment IDs. That is its own report and not the point here. The point is what `/recurring` did with those IDs.
**Enumeration** means walking through a list of identifiers one by one, such as 1, 2, 3, and seeing what the server says about each. Look back at the table in Part 5. Each distinct state of a `payment_id` produced a distinct error message:
- nonexistent gives one message
- exists but no card gives another
- card incomplete gives another, and this one leaked an internal database record ID
- card expired gives another
- card active gives the slow "declined" path
Five differentiable responses make an oracle. With no rate limiting, you can iterate `payment_id` sequentially and the server sorts every ID in the system into a bucket for you: does not exist, no card, broken card, dead card, live card. **Rate limiting** is a cap on how many requests a server will accept from you in a given time. Without it, nothing slows you down. You can map the entire payment database and pre-select every chargeable target before firing a single real charge.
**Technique lesson:** any time the server gives you different responses for different back-end states, you have been handed a classifier. Error-message differences, status-code differences and timing differences are all the same weapon: the server distinguishing states it should not let you distinguish. The fix, which is also worth understanding as an attacker because its absence is your opportunity, is to collapse every failure into one identical generic error.
## Part 7: Escalation, turning a High into a Critical the honest way
The initial report was scored High. Here is the reasoning that moved it, and the reasoning is more useful to you than the outcome. Bug bounty platforms usually grade findings by **severity**, a rough measure of how bad the bug is, with labels such as Low, Medium, High and Critical.
A theoretical IDOR ("the check can be bypassed") and a proven one ("I moved money across users") are graded differently, and they should be. So the escalation demonstrated the full chain end to end:
1. Register a fresh account, free, with no CAPTCHA.
2. Pull a token via the OAuth implicit flow.
3. Point `/recurring` at a card that was actually live, with `website_user_id` omitted.
4. Get back `transaction_successful: true`, a brand-new payment record, and a `net_usd_equivalent` that went negative, meaning the processor fee exceeded the charge. A negative net only happens if a real fee was really assessed by a real network. That number is a receipt.
Step 4 deserves a plain explanation. `net_usd_equivalent` is the amount left after fees, expressed in US dollars. If you charge a tiny amount and the processor takes a fixed fee, the net can come out below zero. That can only happen if a real fee was really charged by a real network, so the negative number is proof that the charge was not simulated.
That single successful cross-user charge took the finding from "can be bypassed in theory" to "an attacker with a free account moved money out of a stranger's card". That is the difference between a mid-tier bounty and a top one.
But, and this is the part most write-ups leave out because it is not flattering, the proof was performed against another user's real card. The program's response was clear: refund it, and for any future proof of concept use your own accounts and your own cards. A **proof of concept**, or PoC, is the demonstration that a bug is real, usually the smallest set of steps that shows it. The author states the boundary plainly: you almost never need someone else's card to prove a payment IDOR. Register two accounts you control, save a card to account B, and charge B's card from account A's token with the ownership parameter omitted. Same proof, same severity bump, zero collateral. If the only way to demonstrate impact is by touching a real victim, stop and talk to the program first; a good triager will often set up a test account for exactly this.
**Lesson four:** severity is a story about demonstrated impact, not possible impact. Learn to build the end-to-end proof, and learn to build it entirely inside accounts you own.
## Part 8: The bonus, an OAuth chain that removed the account requirement
While mapping the login surface in Part 2, the researcher had noted the implicit flow. It turned into a second escalation, and it stacks three classic OAuth mistakes.
**`redirect_uri` path not validated.** A `redirect_uri` is the address the login provider sends you back to after you approve. The provider checked the domain but not the path. The **domain** is the main part of an address, such as `example.com`; the **path** is the part after the slash, such as `/some/page`. Any path on the trusted domain was accepted as a redirect target, so a token could be delivered to an arbitrary page on that domain.
**Token in the query string, not the fragment.** The implicit grant put `access_token` in `?access_token=...`. The **query string** is the part of a web address after a question mark, carrying extra data. The **fragment** is the part after a `#`. The OAuth specification, RFC 6749 section 4.2.2, mandates the fragment precisely because query strings get logged server-side, swept up by analytics and tag managers, saved in browser history, and can leak via the `Referer` header, which is a field browsers send to tell a site which page you came from. Query-string token delivery is a token-disclosure bug by construction.
**Silent auto-approval.** With an existing session, meaning a very long-lived cookie, the authorisation completed with no consent screen: two server-side redirects and the token was issued. A **consent screen** is the page that asks "do you allow this app to access your account?".
Chained together: a victim who is logged into any property in that ecosystem clicks one link, the flow auto-approves, and their own token lands somewhere it can be read. The attacker then does not even need their own account; they act as the victim, and the charge logs show the charge was authorised by the victim's session, which is a forensics nightmare on top of everything else.
The program partially disputed this leg, because it depended on being able to place content on the trusted domain, which was not independently proven, and tracked the `redirect_uri` handling separately. The author accepts that as a fair call: not every link in a chain will be accepted. Report the chain, let the program score the parts it can verify, and do not die on the hill of the parts you cannot.
**Lesson five:** note the weird thing when you see it, even if you do not need it yet. The implicit-flow observation from recon in Part 2 became a whole second escalation in Part 8. Hunters who keep a running list of "that is odd" details are the ones who assemble chains later.
## Part 9: Root cause and the fix, stated cleanly
For completeness, and because understanding the fix sharpens your eye for the bug:
- **The permission bug:** identity for a permission decision was read from a client-supplied body parameter. **Fix:** derive identity from the token server-side and validate ownership unconditionally, ignoring any client-sent user id.
- **The enumeration oracle:** distinct errors per back-end state. **Fix:** one identical generic error for every failure mode.
- **No rate limiting** on a money endpoint. **Fix:** rate-limit it.
- **The unauthenticated data endpoint** feeding IDs. **Fix:** authenticate it; it was ultimately taken offline.
- **The OAuth issues:** exact-match `redirect_uri`, fragment-only token delivery, a real consent screen, and proper cookie flags. A **cookie flag** is a setting on a cookie that controls when and how it is sent, for example only over secure connections.
When the fix finally shipped, it closed the chain in several places at once: the ID source was removed, the endpoint began requiring real client credentials, and a guessable default secret was rotated out. A **default secret** is a password or key that ships with software and is meant to be changed; if nobody changes it, everyone knows it. A layered fix for a layered bug.
## Part 10: The methodology, distilled into a checklist you can run
Everything above compresses into a repeatable process. This is the actual loop:
1. **Draw the trust diagram.** Every host, every handoff, which token authorises what. Do not test until you can draw it from memory.
2. **Find the cheapest path to "authenticated".** No CAPTCHA on registration is a force multiplier: it turns "requires an account" from a mitigation into a nuisance.
3. **Enumerate the money verbs.** `/refund`, `/recurring`, `/capture`, `/subscribe`, `/void`. Each is a separate code path with its own permission story.
4. **For every object reference, ask two questions, not one:** is there an ownership check, and can I make it not run? Omit the parameter, empty it, duplicate it, change the content-type.
5. **When the app hides the outcome, measure the physics.** Timing differences and error-class differences reveal states the words will not.
6. **Build the end-to-end proof inside accounts you own.** Two accounts, your own cards, full chain, receipts.
7. **Report the whole chain, accept partial credit gracefully.** Let the triager score what they can verify.
## Part 11: The uncomfortable, essential lesson about automation
Here is the thing nobody puts in their highlight-reel write-up.
During this hunt, the program flagged thousands of automated requests coming from a single IP and issued a formal warning: high-volume automated scanning violated their rules, and a repeat could damage future reports. An **IP address** is the number that identifies a computer on a network. They let it slide that time because the finding mattered. That is a courtesy, not a right.
The author tells this on purpose, because it is the exact tension at the centre of running a hunting harness: automation is how you find these bugs at scale, and undisciplined automation is how you get thrown out of the programs that would have paid you. A **harness** here means a set of tools the researcher built to send requests, measure responses and flag suspicious patterns automatically. Both things are true. The skill is not "scan harder". The skill is building tooling that is surgical: that measures timing on a handful of targeted requests instead of blasting thousands, that respects rate limits, that reads a program's rules before it runs, and that knows the difference between "enumerate carefully within scope" and "hammer the target". **Scope** is the list of systems a program allows you to test.
A harness that finds critical bugs but gets you warned is a half-built harness. The other half is restraint, and restraint is a feature you engineer in, not a mood you are in on a good day.
## The harness behind this, and how to build your own
The researcher did not find this by hand. The initial signal, the timing cliff between local rejections and real processor round-trips and the five-way error-class split on `/recurring`, surfaced out of a personal hunting harness: tooling built to map trust boundaries, compare responses by timing and error class, and flag exactly the "permission that only fires conditionally" pattern from Part 3.
This finding is one of more than fifteen the harness has surfaced across the author's HackerOne reports. HackerOne is a bug bounty platform where companies list programs and researchers submit findings. Not all of them resolve; triage, duplicates and scope disputes are part of the job. But the ones that land, land because the harness is tuned to notice weak signals like a half-second timing gap that a human eye slides right past.
The author says he is putting together an online course teaching this one-on-one, live, one finding at a time. Not a pre-recorded course you half-watch. Live, your questions, your targets, your tooling.
If that is something you want, the contact address given in the report is [redacted].
**Bounty: $5,000.**
## Glossary
- **Access token**: a string that proves your identity to a server, like a cloakroom ticket.
- **API**: a defined set of addresses and rules one program uses to talk to another; the service counters of a piece of software.
- **Authenticate**: to prove who you are.
- **Authorisation**: what you are allowed to do once you have proved who you are.
- **Bounty**: money a company pays a researcher for reporting a valid bug.
- **CAPTCHA**: a puzzle meant to tell humans from programs.
- **Chargeback**: when a cardholder disputes a payment and the money is pulled back.
- **Consent screen**: the page asking whether you allow an app to access your account.
- **Cookie**: a small piece of data a site stores in your browser and gets back with each request, used to remember you are logged in.
- **Cookie flag**: a setting controlling when and how a cookie is sent, for example only over secure connections.
- **Default secret**: a password or key that ships with software and is meant to be changed.
- **Domain**: the main part of a web address, such as `example.com`.
- **Downstream**: further along the chain, closer to the final system that does the work.
- **Endpoint**: a specific address on a server that performs one job.
- **Enumeration**: walking through identifiers one by one to learn what the server says about each.
- **Fragment**: the part of a web address after a `#`.
- **Gateway**: the entry point to a payment network.
- **Grant**: in OAuth, the recipe used to hand out a token.
- **Harness**: a set of tools that sends requests, measures responses and flags patterns automatically.
- **Hostname**: the part of a web address after `https://`, naming a particular server.
- **IDOR**: Insecure Direct Object Reference; naming an object by its identifier without the server checking it is yours.
- **Implicit grant**: an older OAuth recipe that returns the token directly in the web address.
- **IP address**: the number identifying a computer on a network.
- **JSON**: a common text format for structured data, pairing names with values.
- **OAuth**: a standard letting one system grant another permission on your behalf without your password.
- **Oracle**: any way of asking a system a question it does not intend to answer and getting a usable answer.
- **Parameter**: a named piece of data sent with a request, like a field on a form.
- **Path**: the part of a web address after the domain, such as `/some/page`.
- **POST**: a standard request type meaning "here is some data, please act on it".
- **Proof of concept (PoC)**: the demonstration that a bug is real, usually the smallest set of steps that shows it.
- **Query string**: the part of a web address after a question mark, carrying extra data.
- **Rate limiting**: a cap on how many requests a server accepts from you in a given time.
- **Reconnaissance (recon)**: the information-gathering phase before testing.
- **Redirect URI**: the address a login provider sends you back to after you approve.
- **Referer**: a header browsers send telling a site which page you came from.
- **Request body**: the part of a request carrying the data, as opposed to the address or headers.
- **Round-trip**: one request going out and one answer coming back.
- **Scope**: the list of systems a program allows you to test.
- **Seam**: a place where one system hands work off to another.
- **Severity**: a rough measure of how bad a bug is, such as Low, Medium, High or Critical.
- **Single sign-on (SSO)**: one login working across several different systems.
- **SSRF**: server-side request forgery; tricking a server into making a request on your behalf.
- **Token**: a string standing in for your identity, so you do not resend your password.
- **Triager**: the person who reads reports and decides whether they are valid and how serious.
- **Verb**: the action part of a web address, such as `/refund` or `/recurring`.
- **Webhook**: an automatic message one system sends to another when something happens.