Skip to content
← RegistryDossier · 6 steps · 5 edges

Predictable RNG → forge password-reset tokens

App generates reset tokens via Math.random / Mersenne Twister seeded with time(). Capture a few legit tokens, recover the internal state, predict the next token for any user.

Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll

§ Context

Assumed environment: a self-hosted Node / Java / PHP app uses non-cryptographic RNG for security-sensitive tokens. Attacker can register accounts to obtain reset-token samples.

§ Steps

  1. 01
    Account takeoverInitial Access
    T1078Valid Accounts
  2. 02
    Request password reset for victimInitial Access
    T1078Valid Accounts
  3. 03
    Collect several reset tokens from attacker accountsInitial Access
    T1078Valid Accounts
  4. 04
    Submit predicted token + new passwordPersistence
    T1098Account Manipulation
  5. 05
    Predict next token for victim accountCredential Access
    CR-WEAK-RNGPredictable Random Number Generation
  6. 06
    Reverse RNG internal state (mt-extractor)Credential Access
    CR-WEAK-RNGPredictable Random Number Generation

§ References

§ Frequently asked

What is the "Predictable RNG → forge password-reset tokens" attack path?
App generates reset tokens via Math.random / Mersenne Twister seeded with time(). Capture a few legit tokens, recover the internal state, predict the next token for any user. It chains 6 steps drawn from real-world offensive-security techniques.
What starting position does this attack require?
The first step is Account takeover (T1078) — a initial access primitive. Assumed environment: a self-hosted Node / Java / PHP app uses non-cryptographic RNG for security-sensitive tokens.
What is the final impact of this kill-chain?
The final step lands on Reverse RNG internal state (mt-extractor) (CR-WEAK-RNG), which falls under Credential Access. From here, an operator typically pivots into post-exploitation or maintains persistence.
How can defenders detect or prevent this attack?
Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.

§ Related dossiers