Predictable numbers or identifiers are generated when applications use counters, timestamps, user-visible patterns, or weak randomisation for values that should be hard to guess. Attackers can enumerate them to access records or impersonate transactions. Defenders should use unguessable identifiers where exposure matters, compare design assumptions against actual predictability, and test for sequential or patterned outputs.
Why predictable identifiers happen
Predictability usually comes from the generation method, not from the identifier format itself. Counters, timestamps, and visible business patterns create values that are easy to infer, while weak randomisation can repeat or cluster in ways attackers can observe. In practice, predictability becomes a security problem when the identifier is also used as a record handle, transaction reference, or access key.
Design choices matter because the same pattern can be harmless in one context and dangerous in another. A sequential order number may be acceptable for customer-facing receipts, but it is risky when the value is exposed in URLs, APIs, password-reset links, or any workflow where guessing one value reveals or reaches another user’s data.
Weak generation often appears during development shortcuts: using time-based seeds, reusing a pseudo-random generator incorrectly, or assuming that “hard enough to notice” is the same as “hard enough to guess.” Those are the conditions that make outputs drift from random-looking to enumerable, especially when an attacker can query the system repeatedly and compare results.
Where predictable outputs become exploitable
Once identifiers are predictable, the problem is typically exposure through enumeration rather than cryptographic breakage. An attacker does not need to crack the system if they can walk the sequence, test nearby values, and discover which ones return valid records, sessions, tokens, or transaction objects. That is why predictability is often a direct enabler for IDOR-style access and transaction impersonation.
The practical failure mode is usually assumption mismatch: the application treats the identifier as if it were private, but the implementation makes it observable, sequential, or statistically narrow. Where values are embedded in URLs, API paths, logs, or front-end state, the attack surface grows because the pattern is easier to harvest and replay.
Predictability also creates operational leakage. Even when direct access is prevented, sequential or patterned values can reveal volume, timing, user activity, growth rate, or system internals. That exposure can support target selection, scraping, fraud, and abuse of business workflows.
How to reduce the chance of guessing
The safest response is to separate external identifiers from internal record ordering. Use unguessable identifiers where exposure matters, and keep any business-friendly numbering scheme out of security decisions. If a value must be user-visible, do not let that same value become the sole authority for fetching or changing a protected object.
Testing should focus on whether the output is actually predictable under real conditions, not whether it merely looks random in a small sample. Review the algorithm, seed source, reuse behaviour, and any timestamp or counter dependency, then validate the resulting identifiers across multiple runs and request patterns. For code review purposes, the CWE Top 25 Guide is a useful starting point for the root-cause weakness behind predictable values.
Where a design already exposes sequential or patterned values, add a compensating control that limits what the identifier can authorize. The key question is whether the identifier is merely descriptive or whether it also gates access, disclosure, or state change. If it does both, treat predictability as a security defect, not just a cosmetic weakness.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP API Security Top 10 | API1 — Broken Object Level Authorization | Predictable IDs enable object guessing and unauthorized object access. |
| Recommendation — Enforce object-level authorization on every identifier lookup. | ||
| MITRE ATT&CK | T1595 — Active Scanning | Attackers enumerate predictable values to discover valid records or endpoints. |
| Recommendation — Monitor and rate-limit enumeration against identifier-bearing endpoints. | ||
| CIS Controls v8 | CIS-16 — Application Software Security | Secure coding should prevent predictable tokens, IDs and other guessable values. |
| Recommendation — Review application logic to remove predictable identifier generation. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | When identifiers function as authenticators or secret-bearing references, lifecycle control matters. |
| Recommendation — Rotate or replace any identifier that also serves as a secret or access token. | ||
| OWASP ASVS | V9 — Self-contained Tokens | Guessable token-like identifiers undermine secure token design and session handling. |
| Recommendation — Use non-guessable token design and reject sequential token patterns. | ||
Practitioner Guidance
What to verify: Check whether the value is ever exposed outside trusted server-side logic, because predictability becomes material when the identifier can be guessed and then dereferenced. Validate that any public reference is mapped to a separate access-controlled object, not used as the control itself.
Decision rule: If a predictable value can reach a sensitive record, session, or transaction, prioritise redesign over “hardening” the sequence. If predictability is limited to a benign display number, focus on privacy and disclosure impact rather than access control.
Common mistake: Teams often fix the randomness source but leave the object lookup unchanged, which still allows enumeration if the surrounding workflow trusts the identifier too much. The weakness is usually in the end-to-end design, not only in the generator.
Practitioner takeaway: Predictability is dangerous when it turns an identifier into a shortcut for discovery or access, so judge the value by what it unlocks, not by how convenient it is for the application.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org