Skip to content
Account takeover Write-up Intermediate

How the cookie crumbls

The phone-code login flow had no brute-force protection and used only a four-digit code, so an attacker could guess codes across many phone numbers at once. This let an attacker take over many customer accounts, read personal details and place orders or buy gift cards using saved payment methods.

medium.com

Published on medium.com

This is a story of a very easy to detect critical vulnerability in Crumblcookies.com authentication flow that went unnoticed for years.

Collin potter, on 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.

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 login endpoint accepted unlimited code guesses and used a short four-digit code, with no limit on concurrent login sessions per phone number.

Impact

An attacker could take over many customer accounts, disclosing names, full addresses, card details and order history, and could place orders or buy gift cards charged to saved payment methods.

What the attacker needed

No account needed to start; ability to send many requests; victim phone number known or guessed

The fix

The issue was fixed by adding brute-force protection, lengthening the login code to at least six digits and limiting concurrent login sessions per phone number.

How it was found

  1. Go to the login page and enter any name and phone number.
  2. Intercept the request that asks for a login code and send it to the intruder tool.
  3. Enter any four-digit code in the browser and intercept the validation request.
  4. On the code-request, vary the last four digits of the phone number across all 0000-9999 values and extract the returned request identifiers.
  5. On the validation request, pair each extracted identifier with a small set of guessed codes and run the attack.
  6. Spot successful guesses by their different response lengths.

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.

When you log in with a phone number, the site sends a short numeric code by text message. If the site lets someone try thousands of guesses quickly and the code is only four digits, a computer can simply guess until it gets in. Here that guessing could be done for many customers at the same time, so many accounts could be broken into.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.