How an API Token Flaw Let Me Bypass Premium Restrictions
API tokens created during a free trial remained valid after the trial expired, so the web app blocked login but the CLI still accepted the token. An attacker could keep using premium features without paying.
medium.com
Published on medium.com
Hi Guys, Welcome back to yet another article, Today, I want to walk you through one of the bugs I found while hunting on HackerOne. I was still able to use premium features of the web app, even after my free trial had expired.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the API token's validity was not tied to the user's subscription or trial status, so token checks bypassed the account lifecycle enforcement.
Impact
Users could continue accessing premium features after their free trial ended, which could lead to revenue loss for the company.
What the attacker needed
A free trial account; an API token created during the trial; the CLI program installed
The fix
API tokens should be automatically expired or revoked when the trial ends, and token validity should be tied to subscription status.
How it was found
- Sign up for the free trial and create an API token.
- Wait for the trial to expire and confirm the web app blocks login.
- Read the documentation to find the CLI program that accepts API tokens.
- Install the CLI program and authenticate with the old token.
- Use the CLI to perform actions despite the expired trial.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A free trial gives temporary access to paid features. The website correctly stopped the user from logging in after the trial ended, but a separate command-line tool still trusted an old API token. An API token is like a password for software, and it should stop working when the account's access ends.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.