getrandbits

python · random
sourceDerived from model facts
RoleSource
WeaknessCWE-330 · CWE-338
WatchesReturnValue
Kindweak-random
Confidencemedium
Corroboration2

Source boundary: A random value is used where an attacker may benefit from predicting it.

Argument map · what each slot does

The pack does not provide a callable signature for this record; the watched access path is shown directly.

No positional argument is specified; inspect the return value or named access path in the model facts below.
The weakness
CWE-330
Insufficiently Random Values

Values are predictable where security depends on unpredictability.

CWE-338
Cryptographically Weak PRNG

A non-cryptographic pseudo-random generator is used for security-sensitive values.

What goes wrong
Attacker's-eye view · weak-random

Observed outputs or predictable seeds let an attacker guess a token, identifier, or secret.

// modeled boundary: ReturnValue getrandbits(attacker_influenced_value);
To decide if this call is a bug, check
1Use a cryptographically secure generator for secrets.
2Inspect seed and state handling.
3Check token length and lifetime.
These checks require the surrounding codebase. The model names the boundary; it does not decide reachability or prove that a guard dominates every path.
Is this a bug in your code?Atropos stops here — by design

Atropos identifies ReturnValue as a weak-random source. It cannot see whether untrusted data reaches this call in your repository.

Lachesis is the codebase-level step: it traces reachability and guards for this symbol.

Check this symbol in Lachesis
The family · weak-random
Model facts · verbatim from the pack
RoleKindAccess pathModel IDConfidence
sourceweak-randomReturnValuepython.random.getrandbits.retmedium · corrob. 2