# Predictable security token or capability identifier

A security token relies on randomness that does not meet its unpredictability requirement.

**Candidate CWE:** [CWE-338](https://cwe.mitre.org/data/definitions/338.html)

## Test hypothesis

Locate token generation in source and identify the random source, entropy input, encoding, and lifecycle. Generate a small synthetic fixture set locally and test a concrete prediction hypothesis. Compare against a cryptographically secure generator; do not brute-force live accounts.

## Evidence required

Show a prediction or generator-state argument sufficient to produce a valid controlled token, plus its accepted privilege and lifetime. Use a more precise CWE if the actual cause is insufficient entropy or an exposed token rather than the PRNG choice.

## Rule out false positives

Sequential public record IDs are not authentication secrets by themselves. A tiny sample passing or failing a statistical test does not establish cryptographic predictability.

## Playbook and command references

- [Authentication, recovery, federation, and session lifecycle](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/identity-session.html) — Test registration, recovery, identity changes, invitations, SSO enforcement, and deprovisioning as one account state machine.
- [Source review: entry point to protected operation](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/source-dataflow.html) — Trace attacker control and authorization through handlers, services, queues, and sensitive operations; promote only reachable violations of a stated invariant.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=Authentication%2C%20recovery%2C%20federation%2C%20and%20session%20lifecycle)

## Referenced by these target playbooks

[Web & API](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/web-api.html) · [OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html) · [Mobile](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/mobile.html) · [Desktop & extensions](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/desktop.html) · [AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html)

## Report checklist

- [ ] Capture the affected version, configuration, identities, and object ownership.
- [ ] Preserve a valid baseline and a negative control.
- [ ] Reproduce the forbidden data access, action, or state change on controlled fixtures.
- [ ] Explain the intended security rule and why the observed behavior violates it.
- [ ] State prerequisites, uncertainty, cleanup, and the smallest demonstrated impact.

## Conditional ATT&CK mapping

No direct ATT&CK mapping selected. Record the weakness and demonstrated impact without forcing an adversary-behavior classification. See the [mapping guide](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html).

## Primary references

- [OWASP session management](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)

[Back to the complete vulnerability catalog](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities.html)
