# Predictable reset and verification tokens

Tokens built from clocks, weak PRNGs, UUIDv1 or client IDs instead of a CSPRNG bound to one account

_Area: Web authentication and account takeover. Seen in 10 disclosed reports; 2 confirmed bounties: $5,000 and $10,000; latest 2026-12-05. Updated 2026-12-05._

## How it works
A reset, OTP or SSO token is the only thing between an attacker and an account. It breaks when the token is not a fresh CSPRNG value but is derived from something an attacker can predict, narrow, or reuse. Two failures appear in the evidence: **low entropy** (a time-seeded PRNG, a UUIDv1, a clock timestamp, a narrowed VBScript seed, a Math.random-derived sid) and **determinism or bad binding** (the same token returned per phone number, or a code bound to a reusable client identifier). In both, the assumption "the attacker cannot produce, narrow, or share the token" is false.

## Where it shows up
- Tokens that look like UUIDs — check the version nibble; V1 leaks timestamp, clock sequence and MAC [E5](https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md).
- Non-crypto PRNGs feeding tokens, salts or keys: `Random()`, `math/rand`, `Randomize`/`Rnd`, `Math.random()` [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md)[E4](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md)[E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md)[E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- Seeds taken from a clock (`TickCount`, `UnixNano`, `GetLocalTime`, `currentTimeMillis`) [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md)[E3](https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md)[E4](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md)[E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- Session or verification identifiers returned *before* the OTP is checked [E8](https://bugbountylibrary.com/r/h1%3A1245762.md).
- Codes bound to a client-supplied identifier (`device_id`, cookie, header) rather than to the account [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- Server-side caches keyed by the token string itself [E3](https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md).
- Nominal bit counts that hide a weak PRNG underneath (a hash/KDF after the fact cannot restore entropy) [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).

## How to review
State the invariant: **each token must come from a CSPRNG, be unique per request, and be bound to exactly one account and one attempt.** Check:
- Is the value random, or does it encode time, MAC, sequence, or a hash of user input?
- Does calling the issuing endpoint twice with identical input return identical tokens? If yes, unsafe [E8](https://bugbountylibrary.com/r/h1%3A1245762.md).
- Is the code validated against the account, or against a reusable client identifier? Can that identifier be reused across accounts? [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md)
- For UUIDs, confirm version 4, not v1 [E5](https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md).
- Grep for non-crypto PRNGs and clock seeds in secret/token generation [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md)[E4](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md)[E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md)[E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- Count the *actual* output entropy after any derivation/shuffle step, not the input space [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).

## How finders spotted it
- Saw reset tokens were custom-encoded `Random().Next()`, knew the default seed is `TickCount` at 1ms resolution, hypothesized simultaneous requests could collide, then verified with two test accounts using a Burp single-packet attack and round-trip timing [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md).
- Noticed `Randomize` inside a loop, then disassembled the seeding path and found bare vs explicit seeds convert differently; ~10,000 local runs gave only 400 unique tokens [E4](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md).
- Binary-diffed the last vulnerable build against the fix, saw only the SSO ticket generator changed, then read source confirming the ticket equals `currentTimeMillis()` and is cached verbatim [E3](https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md).
- Noticed the reset token was UUIDv1, not v4, and reasoned V1 embeds timestamp/MAC/clock sequence [E5](https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md).
- Code review of Go secret generation found `math/rand` seeded with `UnixNano`, then looked for a public timestamp plus a hashid oracle to recover the seed [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- Intercepted the mobile login flow, saw `/SessionCreate` returned a token before verification, and confirmed two calls for one number returned the same token [E8](https://bugbountylibrary.com/r/h1%3A1245762.md).
- Traced a wallet app's BIP39 entropy back to `WordArray.random()`, then reasoned the MWC/Math.random seeding collapsed the search space enough to enumerate on commodity hardware [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).
- Sensors saw repeated `loginSrp1` POSTs each returning a fresh signed cookie with a `Math.random()`-derived sid, and reasoned enough outputs would leak the PRNG state and signing key [E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md).

## Variants seen
- Time-seeded PRNG reset tokens, identical within one millisecond [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md).
- Millisecond-timestamp SSO ticket cached under its own string [E3](https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md).
- VBScript `Randomize` with ~65,536 effective seeds [E4](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md).
- UUIDv1 reset token narrowed by sandwiching the victim's reset between two own resets [E5](https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md).
- Deterministic pre-verification session token shared per phone number [E8](https://bugbountylibrary.com/r/h1%3A1245762.md).
- `math/rand`/`UnixNano`-seeded signing keys and salts persisted in the database [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md).
- `Math.random()`-derived sid leaking V8 PRNG state and the cookie signing key [E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md).
- MWC/Math.random PRNG behind a nominal 128/256-bit API [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).

## Why fixes fail
Servers upgraded from an old version keep the originally generated weak `secret_key` and salt; only fresh installs get safe values [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md). Updating the library or re-importing the same phrase does not remediate already-derived wallet seeds [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).

## Impact and severity
Full account takeover in every case, including admin sessions and cross-product pivot [E1](https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md)[E3](https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md)[E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md)[E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md)[E8](https://bugbountylibrary.com/r/h1%3A1245762.md). Scale raises impact: E7's success probability grows linearly with the number of accounts requested, reaching 100% at ~1M accounts [E7](https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md); E5's brute force is bounded by the sandwiched timestamp window [E5](https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md); E6 reached 22+ orgs and command execution [E6](https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md); E2 drained ~$5M [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md).

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **OpenSSL** (version not stated): DKIM was introduced at a very unlucky time; or, happy 20 years of CVE-2008-0166 (CVE-2008-0166). Report: https://bugbountylibrary.com/r/blog%3Adreamstation-systems-personal-dkimdebian-html.md
- **Rejetto HFS** (loginSrp1 endpoint / session cookie signing) (version not stated): An Active Intrusion Campaign Against Check Point Security Management Servers (CVE-2026-61500). Report: https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md
- **crypto-js (npm)** < 4.0.0, fixed in 4.0.0: crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain (CVE-2026-71851). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md. Fix: https://github.com/brix/crypto-js/commit/b405ff597fb3ac76a7bdfbc72dca10ba1079b1d5
- **ManageEngine ADSelfService Plus** (SSO ticket generator (CUSTOM_SSO_TICKET cookie handler)) ADSelfService Plus 6528, fixed in ADSelfService Plus 6529: A Millisecond of Predictability: Why CVE-2026-11374 Is Hard to Exploit (CVE-2026-11374). Report: https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md
- **github.com/cloudreve/Cloudreve/v4 (go)** < 4.0.0-20260205113604-ec9fdd33bc54, fixed in 4.0.0-20260205113604-ec9fdd33bc54: Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding) (CVE-2026-25726). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md
- **VBScript** (vbscript.dll Randomize/Rnd) (version not stated): Yet Another Random Story: VBScript's Randomize Internals. Report: https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-08-19-trivial-exploit-on-c-random-html.md
- E2: https://bugbountylibrary.com/r/ghsa%3AGHSA-rg76-677x-56q9.md
- E3: https://bugbountylibrary.com/r/blog%3Abishopfox-com-blog-millisecond-of-predictability-why-cve-2026-11374-hard-to-exploit.md
- E4: https://bugbountylibrary.com/r/blog%3Ablog-doyensec-com-2025-09-25-yet-another-random-story-html.md
- E5: https://bugbountylibrary.com/r/blog%3Alandh-tech-blog-20230811-sandwich-attack.md
- E6: https://bugbountylibrary.com/r/blog%3Agreynoise-io-blog-check-point-security-management-servers-intrusion-campaign.md
- E7: https://bugbountylibrary.com/r/ghsa%3AGHSA-f8xp-wvcx-p6f4.md
- E8: https://bugbountylibrary.com/r/h1%3A1245762.md
