Skip to content
Business logic Write-up Intermediate

How do I Bypass Payment when a Subscription ends so I don’t have to pay for my subscription

An admin-role user could delete the owner-role account from an organisation, which the program initially treated as expected behaviour. Because subscription payments are only billed to the owner account, removing the owner meant the subscription was never charged, letting the organisation keep using the service without paying.

Aidil Arief Follow

Published on aidilarf.medium.com

When I do Bug Hunting. I spend a lot of time looking at the API flow in processing requests.

Aidil Arief, on aidilarf.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 a SaaS platform with an organisation model: an organisation has members, and each member holds one of four access roles. The report lists them from highest to lowest:

  1. Owner
  2. Admin
  3. User
  4. Guest
From the original on aidilarf.medium.com

The feature under examination is membership management, specifically the API call that removes a user from an organisation, together with the billing model attached to it: the platform runs a trial period, and when the trial ends the next subscription payment is billed to the account holding the Owner role. The researcher's interest was in the API flow behind these requests, and the write-up follows that flow from a role-permission question into a payment bypass.

Setup

The finding was reported to a bug bounty program on HackerOne, with the host and organisation identifiers redacted in the published text. Two accounts matter:

  • an account holding the Admin role in the organisation;
  • an account holding the Owner role in the same organisation.

The request carries a User-Agent for Firefox 109 on 64-bit Windows, an Origin and Referer on the target host, and Sec-Fetch-* headers set to same-origin. Authentication is a bearer token in the Authorization header plus a session cookie. No special tooling is described beyond inspecting and replaying the requests.

Finding it

The researcher started by looking for the API request issued when a user is removed from an organisation. The request is a DELETE to an organisation-scoped path, with the target user identified by an email address in a JSON body:

HTTP
DELETE /api/[ORG]/deleteUser HTTP/2
Host: redacted.com
Cookie: *********************
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0)
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
Authorization: Bearer ************
Content-Length: 37
Origin: https://redacted.com
Referer: https://redacted.com/redacted/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

{"user":"[redacted]"}

The important parts are the [ORG] path segment, which scopes the action to one organisation, and the user field, which names the account to remove. Nothing in the request expresses the caller's role or the target's role: the server is expected to derive both from the bearer token and from the organisation membership records. That is exactly the kind of place where a missing authorisation check shows up, so the researcher replayed the request from the Admin account with the Owner's address in the body.

Exploitation

Step 1: remove the Owner with an Admin account

The Admin account sent the request above with [redacted] as the target. The server answered:

HTTP
HTTP/2 200 OK
Content-Type: application/json
Content-Length: 2
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: *
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=0; includeSubDomains
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy:
Server: cloudflare

{}

A 200 OK with an empty JSON object means the deletion was accepted. The Admin role, which sits below Owner in the hierarchy, was able to remove the highest-privileged member of the organisation. The response headers are ordinary application and CDN headers; nothing in them indicates an error or a rejected action.

Step 2: report it and get closed as duplicate

The researcher reported this to the program on HackerOne. A few days later the report was closed as Duplicate.

From the original on aidilarf.medium.com

The researcher then noticed that the original report still carried Informative status and asked the HackerOne Triage team about it. The triage team's answer was that the team had given reasons for treating it as informative, those reasons were still valid, and the report was therefore considered a duplicate. The program's stated reason was:

We don't consider this a security vulnerability. The account owner can be deleted from the platform by an admin user, that is expected behaviour.

So the role hierarchy was, from the vendor's point of view, not a security boundary: an Admin removing an Owner was intended.

Step 3: watch what happens at the end of the trial

The next few days brought the end of the trial period, and the next subscription payment was billed to the Owner role account, as shown in the screenshot below:

From the original on aidilarf.medium.com

Instead, the researcher opened the Admin role account and found no notification that the trial subscription had ended, and at first could not explain why.

Step 4: connect the deletion to the billing

The explanation was the earlier deletion. At that time the researcher had removed the Owner's account from the organisation.

From the original on aidilarf.medium.com

Subscription payments can only be made by accounts with the Owner role. If the Owner role account is not in the organisation, subscriptions will not be billed to anyone other than the Owner role.

From the original on aidilarf.medium.com

That is the bypass: the role-permission behaviour the vendor called expected turns into a billing flaw when combined with the payment model.

Step 5: reopen the report with the new information

The researcher added this information to the previous report that had been closed as Duplicate, describing the bypass of the payments feature on subscriptions. After a few days the HackerOne Triage team sent additional information, which was forwarded to the bug bounty program team for review.

From the original on aidilarf.medium.com

The report was reopened.

From the original on aidilarf.medium.com

Root cause

The design ties billing to the presence of the Owner role account inside the organisation. The removal endpoint lets an Admin remove any member, including the Owner, and the vendor treats that as intended behaviour. The two decisions are individually defensible, but together they leave a state in which an organisation has no Owner and therefore no account to bill, while the organisation itself remains active. Likely the billing logic looks up the Owner membership at renewal time and, finding none, simply skips the charge instead of suspending the organisation or escalating the billing responsibility to another member. The removal endpoint evidently does not check that the caller outranks the target, and nothing prevents the organisation from being left without an Owner.

Impact

An Admin, a role below Owner, can remove the Owner from the organisation, after which subscriptions will not be billed to anyone other than the Owner role. The condition is that the attacker holds the Admin role in the organisation, or can otherwise reach the removal endpoint with the Owner's address. The report does not describe any wider effect, such as data loss or takeover of other organisations, and the vendor initially classified the removal itself as expected behaviour, so the security weight of the finding rests on the billing consequence.

Fix

The report does not say what the program changed. Two changes would address the issue: enforce the role hierarchy on the removal endpoint so that a caller cannot remove a member whose role is equal to or higher than their own, and make the billing logic treat an organisation without an Owner as a state that must be resolved, for example by blocking the organisation or requiring an Owner to be assigned, rather than silently skipping the charge.

Variants to test

  1. Role hierarchy on other member endpoints. Replay invite, role-change and remove requests from a lower role against a higher-role member. A positive result is a 200 with an empty or success body where the target outranks the caller.
  2. Removing the last privileged member. Remove every Owner and Admin from an organisation and observe billing and access. A positive result is continued access past the renewal date with no charge.
  3. Leaving the organisation instead of being removed. Use the self-removal or leave endpoint from the Owner account and watch the next billing cycle. A positive result is the same skipped payment without any Admin involvement.
  4. Role change before removal. Demote the Owner to a lower role, then remove that account, and check whether billing follows the role or the account. A positive result is a renewal that is not billed.
  5. Transfer of ownership. If the product offers an ownership transfer, transfer to a second account and remove that account, then check which account, if any, is billed at renewal.

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

What happened, in plain words

A researcher was testing a website that sells subscriptions to organisations. Think of it like a shared workspace: several people join one organisation, and each person gets a label that says how much power they have. The labels, from most powerful to least, are Owner, Admin, User and Guest.

The researcher noticed that a person with the Admin label could remove the person with the Owner label from the organisation. That is like a deputy manager being able to fire the managing director. The researcher reported it, and the company said it was not a security problem: an Admin removing an Owner was intended behaviour.

Then the trial period of the subscription ended. Normally the next payment is charged to the account that holds the Owner label. But the Owner had already been removed from the organisation, so there was nobody to charge. The organisation kept working without paying. The researcher added this new information to the old report, and the report was reopened.

This article walks through the same steps for someone who has never done security testing before. It explains every term as it appears.

The product and the feature

The target is a SaaS platform. SaaS means "software as a service": software you use through a browser, where the company runs the servers and you pay a recurring fee. The platform uses an organisation model: one organisation is a container that holds members, and each member has one access role. A role is a label that decides what you are allowed to do. The report lists the four roles from highest to lowest:

  1. Owner
  2. Admin
  3. User
  4. Guest
From the original on aidilarf.medium.com

The higher your role, the more actions you can take.

The feature being examined is membership management: the part of the product where you add people to an organisation, change their role, or remove them. Behind the buttons in the browser, each of those actions sends a request to the platform's API.

An API (application programming interface) is the set of addresses a website's front end uses to talk to its back end. When you click a button, your browser does not reload a whole page; it sends a small message to one of those addresses and gets a small answer back. A useful comparison is a restaurant: the menu is the API, the kitchen is the server, and you never walk into the kitchen yourself. You order from the menu and a waiter brings the result.

The platform also has a billing model: it runs a trial period (a free window at the start), and when the trial ends the next subscription payment is billed to the account holding the Owner role. The researcher's interest was in the API flow behind these requests, and the write-up follows that flow from a role-permission question into a payment bypass.

Setting up

The finding was reported to a bug bounty program on HackerOne. HackerOne is a platform where companies publish bug bounty programs: they invite outside researchers to look for security problems and report them, sometimes for a reward. In the published text the host name and the organisation identifier are redacted, meaning replaced with placeholders so the real names are not shown.

Two accounts matter:

  • an account holding the Admin role in the organisation;
  • an account holding the Owner role in the same organisation.

Having two accounts is essential. To test whether a lower role can act on a higher role, you need to be logged in as the lower one and aim at the higher one.

The requests were captured from the browser, as the headers show: a User-Agent for Firefox 109 on 64-bit Windows, an Origin and Referer on the target host, and Sec-Fetch-* headers set to same-origin. Headers are extra lines of information that travel with every web request, like the label on a parcel: they say who is asking, what format they want back, and where they came from. The User-Agent says which browser was used, Origin and Referer say which page the request came from, and the Sec-Fetch-* headers are added automatically by the browser to describe the kind of request. These headers are consistent with a normal browser session.

Authentication is a bearer token in the Authorization header plus a session cookie. A cookie is a small piece of data the website stores in your browser so it can recognise you on the next request; it is like a wristband at an event that proves you already checked in. A token is a string of characters that acts as proof of identity, and a bearer token is one where simply presenting it is enough, like a cloakroom ticket: whoever holds it gets the coat. Both are redacted in the published request. No special tooling is described beyond inspecting and replaying the requests, which means looking at what the browser sends and sending the same thing again, possibly with a value changed.

Finding it

The researcher started by looking for the API request issued when a user is removed from an organisation. The idea is simple: find the exact message the browser sends when you click "remove member", because that message is where the server decides whether you are allowed to do it. The request is a DELETE to an organisation-scoped path, with the target user identified by an email address in a JSON body:

HTTP
DELETE /api/[ORG]/deleteUser HTTP/2
Host: redacted.com
Cookie: *********************
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0)
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
Authorization: Bearer ************
Content-Length: 37
Origin: https://redacted.com
Referer: https://redacted.com/redacted/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

{"user":"[redacted]"}

Line by line, in plain words:

  • DELETE /api/[ORG]/deleteUser HTTP/2 is the request line. DELETE is the HTTP method, a verb that says what kind of action you want; DELETE means "remove this thing". /api/[ORG]/deleteUser is the address, where [ORG] is a placeholder for the organisation's identifier. HTTP/2 is the version of the protocol used to speak to the server.
  • Host: redacted.com says which website the request is addressed to.
  • Cookie: ********************* carries the session cookie, redacted here. This is what tells the server which logged-in user is making the request.
  • User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) identifies the browser and operating system.
  • Accept: application/json says the caller expects the answer in JSON, a text format for structured data.
  • Accept-Language and Accept-Encoding say which language and compression the caller prefers.
  • Content-Type: application/json says the body of the request is JSON.
  • Authorization: Bearer ************ carries the bearer token, redacted. This is the second piece of proof of identity.
  • Content-Length: 37 says the body is 37 bytes long.
  • Origin and Referer say the request came from a page on the same site.
  • Sec-Fetch-Dest, Sec-Fetch-Mode and Sec-Fetch-Site are browser-added headers describing the request as a same-origin fetch.
  • Te: trailers is a protocol detail about how the connection is handled.
  • The blank line separates headers from the body.
  • {"user":"[redacted]"} is the body: a JSON object with one field, user, whose value is the email address of the account to remove.

The important parts are the [ORG] path segment, which scopes the action to one organisation, and the user field, which names the account to remove. Nothing in the request expresses the caller's role or the target's role: the server is expected to derive both from the bearer token and from the organisation membership records. That is exactly the kind of place where a missing authorisation check shows up. Authorisation means deciding whether an identified user is allowed to do a particular thing; authentication is proving who you are, authorisation is what you may do. If the server only checks that you are logged in and a member, but never compares your role with the target's role, then a lower role can act on a higher one. So the researcher replayed the request from the Admin account with the Owner's address in the body.

Exploitation

Step 1: remove the Owner with an Admin account

The Admin account sent the request above with [redacted] as the target. The server answered:

HTTP
HTTP/2 200 OK
Content-Type: application/json
Content-Length: 2
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: *
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=0; includeSubDomains
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy:
Server: cloudflare

{}

Line by line:

  • HTTP/2 200 OK is the status line. 200 is the standard code for "it worked"; OK is its short description. Other common codes are 403 for "forbidden" and 404 for "not found".
  • Content-Type: application/json says the answer is JSON.
  • Content-Length: 2 says the answer body is two bytes long, which is exactly the length of {}.
  • Access-Control-Allow-Origin: *, Access-Control-Allow-Credentials: true and Access-Control-Expose-Headers: * are CORS headers. CORS is a browser rule that decides which other websites may read the answer; these say any origin may, and credentials may be included.
  • X-Frame-Options: SAMEORIGIN stops the page being embedded in another site's frame.
  • Strict-Transport-Security tells the browser to keep using HTTPS for this site.
  • X-Xss-Protection and X-Content-Type-Options: nosniff are older browser-protection headers.
  • Content-Security-Policy: is present but empty in the published text.
  • Server: cloudflare says the site is served through Cloudflare, a content delivery network that sits in front of the real server.
  • {} is an empty JSON object: the answer contains no data, which is normal for a successful deletion.

A 200 OK with an empty JSON object means the deletion was accepted. The Admin role, which sits below Owner in the hierarchy, was able to remove the highest-privileged member of the organisation. The response headers are ordinary application and CDN headers; nothing in them indicates an error or a rejected action.

Step 2: report it and get closed as duplicate

The researcher reported this to the program on HackerOne. A few days later the report was closed as Duplicate. A duplicate means the program had already received a report about the same issue, so yours is not counted as new.

From the original on aidilarf.medium.com

The screenshot shows the report status in HackerOne. The researcher then noticed that the original report still carried Informative status and asked the HackerOne Triage team about it. Triage is the first review a report goes through: a team reads it, checks whether it is a real security issue, and passes it on or closes it. Informative is a status meaning the report was read and considered useful information but not a security vulnerability.

The triage team's answer was that the team had given reasons for treating it as informative, those reasons were still valid, and the report was therefore considered a duplicate. The program's stated reason was:

We don't consider this a security vulnerability. The account owner can be deleted from the platform by an admin user, that is expected behaviour.

So the role hierarchy was, from the vendor's point of view, not a security boundary: an Admin removing an Owner was intended. A security boundary is a line the product promises users cannot cross, such as "only an Owner can remove an Owner". If the vendor says the line was never meant to exist, then crossing it is not a vulnerability by itself.

Step 3: watch what happens at the end of the trial

The next few days brought the end of the trial period, and the next subscription payment was expected to be billed to the Owner role account, as shown in the screenshot below:

From the original on aidilarf.medium.com

Instead, the researcher opened the Admin role account and found no notification that the trial subscription had ended. The account's subscription had not ended, and at first the researcher could not explain why.

Step 4: connect the deletion to the billing

The explanation was the earlier deletion. At that time the researcher had removed the Owner's account from the organisation.

From the original on aidilarf.medium.com

Subscription payments can only be made by accounts with the Owner role. If the Owner role account is not in the organisation, subscriptions will not be billed to anyone other than the Owner role.

From the original on aidilarf.medium.com

That is the bypass: the role-permission behaviour the vendor called expected turns into a billing flaw when combined with the payment model. A logic flaw is a problem where every individual rule works as written, but the rules combine into an outcome nobody intended. It is like a shop that says "staff get free coffee" and "anyone can become staff by filling in a form": each rule is fine, together they give free coffee to everyone.

Step 5: reopen the report with the new information

The researcher added this information to the previous report that had been closed as Duplicate, describing the bypass of the payments feature on subscriptions. After a few days the HackerOne Triage team sent additional information, which was forwarded to the bug bounty program team for review.

From the original on aidilarf.medium.com

The report was reopened.

From the original on aidilarf.medium.com

Root cause

The design ties billing to the presence of the Owner role account inside the organisation. The removal endpoint lets an Admin remove any member, including the Owner, and the vendor treats that as intended behaviour. The two decisions are individually defensible, but together they leave a state in which an organisation has no Owner and therefore no account to bill, while the organisation itself remains active. Likely the billing logic looks up the Owner membership at renewal time and, finding none, simply skips the charge instead of suspending the organisation or escalating the billing responsibility to another member. The removal endpoint evidently does not check that the caller outranks the target, and nothing prevents the organisation from being left without an Owner.

Impact

An Admin, a role below Owner, can remove the Owner from the organisation, after which subscriptions will not be billed to anyone other than the Owner role. The condition is that the attacker holds the Admin role in the organisation, or can otherwise reach the removal endpoint with the Owner's address. The report does not describe any wider effect, such as data loss or takeover of other organisations, and the vendor initially classified the removal itself as expected behaviour, so the security weight of the finding rests on the billing consequence.

Fix

The report does not say what the program changed. Two changes would address the issue: enforce the role hierarchy on the removal endpoint so that a caller cannot remove a member whose role is equal to or higher than their own, and make the billing logic treat an organisation without an Owner as a state that must be resolved, for example by blocking the organisation or requiring an Owner to be assigned, rather than silently skipping the charge.

Variants to test

  1. Role hierarchy on other member endpoints. Replay invite, role-change and remove requests from a lower role against a higher-role member. A positive result is a 200 with an empty or success body where the target outranks the caller.
  2. Removing the last privileged member. Remove every Owner and Admin from an organisation and observe billing and access. A positive result is continued access past the renewal date with no charge.
  3. Leaving the organisation instead of being removed. Use the self-removal or leave endpoint from the Owner account and watch the next billing cycle. A positive result is the same skipped payment without any Admin involvement.
  4. Role change before removal. Demote the Owner to a lower role, then remove that account, and check whether billing follows the role or the account. A positive result is a renewal that is not billed.
  5. Transfer of ownership. If the product offers an ownership transfer, transfer to a second account and remove that account, then check which account, if any, is billed at renewal.

Glossary

  • API: the set of addresses a website's front end uses to talk to its back end, like a menu you order from.
  • Access role: a label on a member that decides which actions they may take.
  • Admin: the second-highest role in the organisation, below Owner.
  • Authentication: proving who you are, usually with a cookie or token.
  • Authorisation: deciding whether an identified user is allowed to do a particular action.
  • Authorisation check: the server-side test that compares the caller's rights with what the action requires.
  • Bearer token: a string that proves identity simply by being presented, like a cloakroom ticket.
  • Bug bounty program: a scheme where a company invites outside researchers to report security problems, sometimes for a reward.
  • Bypass: getting past a restriction without satisfying it.
  • CORS: a browser rule that decides which other websites may read a response.
  • Cookie: a small piece of data stored in your browser so a site can recognise you on later requests.
  • Content-Type: a header saying what format the body of a request or response is in.
  • DELETE: the HTTP method meaning "remove this thing".
  • Duplicate: a report about an issue the program has already received.
  • Header: an extra line of information sent with a web request or response.
  • HackerOne: a platform where companies publish bug bounty programs and researchers submit reports.
  • HTTP method: the verb in a request, such as GET, POST or DELETE, saying what kind of action is wanted.
  • Informative: a report status meaning the report was read and considered useful information but not a vulnerability.
  • JSON: a text format for structured data, built from names and values in curly braces.
  • Logic flaw: a problem where each rule works as written but the rules combine into an unintended outcome.
  • Organisation model: a design where one organisation is a container holding members with roles.
  • Owner: the highest role in the organisation, and the role that pays the subscription.
  • Replay: sending a captured request again, possibly with a value changed.
  • SaaS: software you use through a browser, run by a company that charges a recurring fee.
  • Security boundary: a line the product promises users cannot cross.
  • Session cookie: a cookie that identifies your logged-in session.
  • Status code: the number in a response saying how the request went, such as 200 for success.
  • Subscription: a recurring payment for continued access to a service.
  • Triage: the first review a report goes through before it reaches the program team.
  • Trial period: a free window at the start of a subscription before the first payment.
  • User-Agent: a header saying which browser and operating system made the request.

More by Aidil Arief

View all

7 more disclosed reports, best first.

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.