Predictable password reset tokens
Collect several reset tokens for accounts you control and analyze structure and entropy. Sequential, timestamp-based, or short tokens are guessable.
bash
# request many, look for structure
for i in $(seq 1 20); do request_reset [email protected]; done
# decode and diff tokens: are they time or counter correlated?
If the token embeds a timestamp, narrow and brute the window.
python
import hashlib,time
for t in range(now-5, now+5):
guess = hashlib.md5(f"{uid}{t}".encode()).hexdigest() # weak scheme
Pro note: also check token lifetime and single-use enforcement; long-lived or reusable tokens widen the attack. If tokens are UUIDs, confirm they are v4 from a CSPRNG, since v1 encodes MAC and time and is predictable.