$20,000 in Gift Cards Leaked - IDOR
Gift card account IDs were near-sequential and the balance-check endpoint had no rate limiting or authentication, so an attacker could enumerate valid gift cards and obtain their balances. Because the ID alone was sufficient to redeem funds, an attacker could use discovered IDs to pay for purchases, leaving victims with empty cards.
medium.com
Published on medium.com
Over the holidays, I received a gift card as a present for a local sushi place. A few weeks later, I went out for sushi with some friends and noticed that the way the gift card was redeemed in the restaurant was odd.
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 gift card account ID was used as the sole authentication secret, was predictable (near-sequential), and the balance-check endpoint lacked rate limiting, allowing enumeration of valid cards.
Impact
An attacker could enumerate valid gift card IDs and use them to make purchases, potentially emptying victims' cards; the author found over $20,000 in valid cards affecting over 300 customers within 30 minutes.
What the attacker needed
Knowledge of a valid gift card ID range; no authentication required; no rate limiting on the endpoint
How it was found
- Scan the QR code on the back of a gift card to obtain the balance-check URL with the account ID parameter.
- Observe that valid IDs return a balance and invalid IDs return an error message.
- Write a script that iterates through a range of account IDs, requesting the balance endpoint for each.
- Check each response for a dollar sign (valid card) or the error message (invalid card).
- Collect the valid gift card IDs and their balances.
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 gift card's ID number was the only thing needed to check its balance or spend it, and those numbers were almost in order. The website that checked balances did not limit how many times someone could ask, so a simple script could try many numbers quickly and find real cards. The attacker could then use those card numbers to pay for things, and the real owners would find their cards empty.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.