The application uses `uniqid()` or `rand()` to generate sensitive cryptographic parameters (such as salts, private keys, or passwords). `uniqid()` is based on the current timestamp in microseconds and `rand()` is not a cryptographically secure pseudo-random number generator (CSPRNG). This lack of entropy allows an attacker to predict or brute-force the gener
Rule Explorer
Search the public rule index by CVE, GHSA, CWE, language, framework, author, or rule slug. Filter by language, framework, severity, confidence, license, and validation status.
- Public rules
- 2917
- Downloads
- 3.3M
- Verified
- 2917
- Authors
- 2
Generating bytes with Perl's built-in rand() (e.g. `chr rand 256`) is insecure for any cryptographic purpose. Perl's rand() is a non-CSPRNG with a small, predictable internal state; bytes derived from it can be reproduced or brute-forced by an attacker. Use an OS CSPRNG such as Crypt::SysRandom::random_bytes(), Crypt::URandom, or Crypt::PRNG instead.
Authentication/API token is generated using itsdangerous.URLSafeTimedSerializer keyed by a non-secret value (e.g. tenant_id) and/or signing a predictable payload such as a UUID, with the output being sliced. This treats the serializer as a randomness source instead of a verifiable signed token. URLSafeTimedSerializer produces deterministic base64(payload).ti
A cryptographically weak pseudo-random number generator (PRNG) was detected. Functions like `random()`, `rand()`, or weak wrappers (e.g., `turn_random()`) lack sufficient entropy for generating security-sensitive values like authentication nonces, keys, or for port randomization. This allows attackers to reconstruct the internal state and predict future valu
Security-sensitive token is derived from a non-cryptographic PRNG (mt_rand() and/or uniqid()) and then hashed (sha1/md5/hash). Mersenne Twister state is recoverable from a small number of outputs, and uniqid() encodes a microsecond timestamp (~20 bits of entropy). Hashing does not add entropy. Use random_bytes() (or random_int()) as the entropy source for au
The error from crypto/rand.Read (or uuid.NewRandom, which wraps crypto/rand) is silently swallowed: the failure path either returns without surfacing the error, returns the all-zero UUID constant, or falls back to another UUID/token generator. When the OS entropy source fails, the resulting identifiers become predictable (e.g. always the zero UUID), which br
Session/token identifier is derived by hashing the output of Perl's built-in rand(), which is a non-cryptographic PRNG seeded with only ~32 bits and is therefore predictable. Combining it with $$ (PID), time, or stringified references (memory addresses) does not add meaningful entropy, and wrapping the result in a digest (sha1_hex/md5_hex/sha256_hex/...) doe
Generating session seeds or cryptographic tokens using weak sources of entropy like `time` and `rand` leads to highly predictable values. An attacker can brute-force or correlate these inputs to guess the final output, leading to session hijacking. Use a true CSPRNG (e.g., Crypt::SysRandom or Math::Random::Secure) instead.
Generation of multipart boundaries using the cryptographically insecure `Math.random()` was detected. Boundary values can be predicted and used to inject malicious parts into the multipart request if they are sent to an attacker-controlled server alongside legitimate endpoints.
Perl's built-in rand() is being fed into a cryptographic hash (SHA-1/SHA-256/SHA-512/MD5) to derive bytes. rand() is seeded with at most 32 bits and is not a CSPRNG, so hashing it (optionally with $$, Time::HiRes::time, or other low-entropy values) does not produce cryptographically strong output. This pattern produces predictable session IDs, CSRF tokens, a
Use of the insecure `rand()` function to populate an array or pointer. `rand()` is deterministic and not cryptographically secure. For authentication challenges, session IDs, or cryptographic keys, this can lead to prediction or replay attacks. Use a CSPRNG like `getrandom()`.
Go's `math/rand` is not meant for use in generating random numbers for any cryptographic or security sensitive context. This includes generating random numbers that could be used in user specific identifiers or where the random number that is generated is considered to be secret. Replace all imports of `math/rand` with `crypto/rand`.
Depending on the context, generating weak random numbers may expose cryptographic functions, which rely on these numbers, to be exploitable. When generating numbers for sensitive values such as tokens, nonces, and cryptographic keys, it is recommended that the `randomBytes` method of the `crypto` module be used instead of `pseudoRandomBytes`. Example using `
Depending on the context, generating weak random numbers may expose cryptographic functions, which rely on these numbers, to be exploitable. When generating numbers for sensitive values such as tokens, nonces, and cryptographic keys, it is recommended that the `secrets` module be used instead. Example using the secrets module: ``` import secrets # Generate a
Depending on the context, generating weak random numbers may expose cryptographic functions which rely on these numbers to be exploitable. When generating numbers for sensitive values such as tokens, nonces, and cryptographic keys, it is recommended that the `RandomNumberGenerator` class be used. Example `RandomNumberGenerator` usage: ``` Int32 randInt = Ran