Skip to content
OpenAdvisories

Weakness (CWE)

CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

Base Draft

The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.

More detail

When a non-cryptographic PRNG is used in a cryptographic context, it can expose the cryptography to certain types of attacks.

Often a pseudo-random number generator (PRNG) is not designed for cryptography. Sometimes a mediocre source of randomness is sufficient or preferable for algorithms that use random numbers. Weak generators generally take less processing power and/or do not use the precious, finite, entropy sources on a system. While such PRNGs might have very useful features, these same features could be used to break the cryptography.

How to prevent it (1 mitigation)
  1. Implementation

    Use functions or hardware which use a hardware-based random number generation for all crypto. This is the recommended solution. Use CyptGenRandom on Windows, or hw_rand() on Linux.

Source: MITRE CWE-338

188 results · Feed

  • Medium 5.1

    Multiple Vulnerabilities in IBM API Connect

    IBM API Connect 10.0.8.0 through 10.0.8.12 could allow a local attacker to obtain sensitive information due to the use of a cryptographically weak pseudo-random number generator.

  • High 8.1

    Multiple Vulnerabilities in IBM API Connect

    IBM API Connect 10.0.8.0 through 10.0.8.12 could allow a remote attacker to gain full administrative control due to the use of a cryptographically weak pseudo-random number generator.

  • Medium 4.8

    Cotonti through 1.0.0 Predictable Validation Tokens via md5(microtime())

    Cotonti through 1.0.0 generates registration and email-change validation tokens with md5(microtime()), allowing attackers to bypass email-ownership verification by predicting tokens. Attackers can derive the generation time from the HTTP Date header and compu…

  • High 7.5

    CallBackery versions before 0.62.0 for Perl allow session cookie forgery via a signing secret generated with rand()

    CallBackery versions before 0.62.0 for Perl allow session cookie forgery via a signing secret generated with rand(). The secret that signs session cookies is built from two calls to the built-in rand(), which is seeded with 32 bits. The secret therefore has a…

  • Medium 6.1

    Administrator Password Reset Through the Verification-Code Interface in TP-Link RE305

    An authentication flaw exists in the password-recovery functionality of TP-Link RE305 V3. The verification-code interface allows an unauthenticated attacker on the same local network to trigger generation of an administrator password-reset verification code. …

  • Low 3.7

    IPv6 stable and temporary interface identifiers derived from a non-cryptographic PRNG secret key

    The IPv6 stack derived the long-lived secret key used to compute RFC 7217 stable interface identifiers (gen_stable_iid() in subsys/net/ip/ipv6.c) and RFC 8981 temporary interface identifiers (gen_temporary_iid() in subsys/net/ip/ipv6_pe.c) with sys_rand_get()…

  • Medium 6.3

    Broken Access Control in extension "TYPO3 Fluid-Form by coding.ms" (fluid_form)

    The download link for files uploaded through a form relied on a token that could be predicted. The file name in the request was also not verified in a way that resisted guessing. An unauthenticated attacker could use this to access files uploaded by other vis…

  • Low 3.7

    diem-project diem dmString.php random weak prng

    A vulnerability was identified in diem-project diem up to 116974edfb9a5b8bd69cb13586dc62bcdbb485ad. This vulnerability affects the function dmString::random of the file dmCorePlugin/lib/basic/dmString.php. Such manipulation leads to cryptographically weak prn…

  • High 7.8

    World-accessible IPC shared memory with predictable name in TightVNC Server

    Incorrect permission assignment in GlavSoft TightVNC Server for Windows before 2.8.88 allows a local authenticated user to read or overwrite the inter-process communication handles used between the TightVNC service and its desktop server process. The named sh…

  • Low 3.7

    AsyncHttpClient: Digest authentication cnonce generated with a non-cryptographic random source

    The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses. Prior to 3.0.12 and 2.16.1, Realm.Builder generates the HTTP Digest client nonce with ThreadLocalRandom rather than a cryptog…

  • Medium 5.9
    CVE-2026-104356 Public exploit

    PictShare < 3.7.1 Predictable Delete Code via rand()

    PictShare before version 3.7.1 contains a weak randomness vulnerability where the getRandomString() function uses the non-cryptographic rand() PRNG to generate the delete_code authorization token in src/inc/core.php. Attackers can predict or infer the PRNG st…

  • Critical 9.1

    GetSimple CMS: Predictable Password Reset Password Allows Administrator Account Takeover

    GetSimple CMS is a content management system (CMS), and GetSimple CMS CE is the community edition of that CMS. In version 3.3.22, the password reset endpoint can be accessed without authentication. When a reset request is submitted for an existing user, the a…

  • Medium 4.8

    Fortra BoKS Server Agent adjoin machine-account password generation vulnerability

    Fortra BoKS Server Agent contains a predictable password generation vulnerability in the adjoin utility. Machine-account passwords generated during Active Directory join or password renewal operations may have significantly less entropy than intended, making …

  • Critical 9.9

    Predictable Active Directory service-account passwords in BoKS Manager

    In deployments using BoKS keytab management, affected versions of boks_keytabmd generate Active Directory service-account passwords from a predictable pseudo-random sequence seeded with the current Unix timestamp. An attacker who knows the service principal a…

  • Medium 6.3

    NetX Secure DTLS server issues predictable HelloVerifyRequest cookies, so a spoofed client can pass the return-routability check

    In Eclipse ThreadX NetX Duo versions 6.0 through 6.5.2.202603a, the NetX Secure DTLS server fills HelloVerifyRequest cookies from NX_RAND(), by default the C library rand(), with no key and no binding to the client. An attacker who can predict the generator's…

  • Critical 9.1

    Unauthenticated recovery of the Math.random() state behind OAuth tokens, authorization codes, client secrets and organization API keys

    Postiz generates security-sensitive credentials using `Math.random()` instead of a cryptographically secure source. The same helper is used for OAuth access tokens, authorization codes, client secrets, organization API keys, and PKCE verifiers, meaning these …

  • High 8.1

    NivoCart through 2.4.0 Predictable Administrator Password Reset Token

    NivoCart through 2.4.0 contains a predictable password reset token vulnerability in the forgotten.php endpoint that generates recovery codes using substr(md5(mt_rand()), 0, 10). Attackers who know an administrator's email address can request a password reset …

  • High 8.1

    Cotonti through 1.0.0 Predictable Password Recovery Token via Weak PRNG

    Cotonti through 1.0.0 derives password recovery validation tokens from md5(microtime()) in users.passrecover.php, creating a predictable token space of approximately one million values per second. Unauthenticated attackers can read the server Date header, pre…

  • High 8.1

    SafeLine through 9.4.1 Authentication Bypass via Weak Session Secret

    SafeLine through 9.4.1 derives the management console session-signing secret from a time-seeded math/rand generator, allowing attackers to reconstruct the key offline. Unauthenticated remote attackers who can bound the install timestamp can regenerate the sec…

  • Medium 4.8

    EspoCRM through 10.0.8 Weak Token Generation via rand()

    EspoCRM through 10.0.8 uses PHP's rand() function to generate tokens for lead-capture opt-in, event invitation, and campaign URLs instead of a cryptographically secure generator. Remote unauthenticated attackers can guess these roughly 31-bit tokens to confir…

  • Medium —

    Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key

    gorilla/websocket used `math/rand` (cryptographically weak pseudo-random number generator) to generate WebSocket frame mask keys prior to commit d67f4185. WebSocket masking keys MUST be unpredictable to prevent frame content injection attacks. math/rand produ…

  • Low 3.7

    openssl_encrypt before 1.4.0 Insecure Random Import in PQC Module

    openssl_encrypt before 1.4.0 imports Python's non-cryptographic 'random' module (Mersenne Twister PRNG) at line 15 of openssl_encrypt/modules/pqc.py. No direct calls to random.* were present in the code, so no cryptographic operation is currently affected; ho…

  • High 7.5

    openssl_encrypt before 1.4.0 Weak PRNG Steganography Pixel Selection

    openssl_encrypt versions before 1.4.0 use Python's non-cryptographic random module for steganographic pixel selection in the generate_pseudorandom_sequence function. Attackers who know the password can recover the Mersenne Twister state from approximately 624…

  • Critical 9.1

    sm-crypto: Predictable SM2 key generation in Node.js: default RNG uses Math.random + wall clock

    sm-crypto provides JavaScript implementations of the Chinese cryptographic algorithms SM2, SM3, and SM4. Prior to 0.5.0, the default no-argument sm2.generateKeyPairHex() path in Node.js uses the module-wide SecureRandom instance in src/sm2/utils.js, supplied …

  • High 7.5

    Data-science-pipelines-operator: dspo: cryptographically weak secret generation (math/rand) for db and s3 credentials

    A flaw was found in the Data Science Pipelines Operator. This vulnerability allows an unauthenticated attacker to derive sensitive credentials, such as MariaDB root/user passwords and MinIO access/secret keys, if they can access the MinIO Route or MariaDB Ser…

  • Critical 9.0
    CVE-2026-71851 Public exploit

    crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain

    crypto-js is a JavaScript library of crypto standards. Versions of crypto-js prior to 4.0.0 generate randomness in CryptoJS.lib.WordArray.random() using a custom variation of the Multiply-With-Carry pseudorandom number generator, seeded from Math.random(), in…

  • High 7.4

    Langflow is affected by weaknesses in secret handling and sensitive configuration access

    IBM Langflow OSS contains a weak cryptographic key derivation vulnerability in the ensure_fernet_key() function.

  • High 8.3

    Spring Boot DevTools remote secret generated with a non-cryptographic PRNG

    When enabling Spring Boot DevTools support for a remote application target (for example a Docker container or Cloud Foundry app) from the Spring Tools Boot Dashboard, Spring Tools generates a shared secret that authenticates DevTools remote-restart uploads to…

  • Critical 9.1

    Joomla Extension - regularlabs.com - Insecure login URL keys in IP login extension

    Joomla Extension - regularlabs.com - Insecure login URL keys in IP login extension - Persistent URL login keys were also generated using a non-cryptographic random generator with insufficient entropy.

  • Medium 6.8

    Librest: weak random number generation in pkce implementation

    A flaw was found in librest. The PKCE implementation for OAuth authorization uses the GRand function from the GLib API, a cryptographically insecure pseudo-random number generator. Because the generated "code verifier" lacks sufficient cryptographic entropy, …

  • High 8.7

    ExtremeXOS Debug-Mode Privilege Escalation via Weak PRNG

    ExtremeXOS (EXOS) uses a challenge-response mechanism to authorize access to the privileged debug-mode function. The challenge value is generated using an insufficiently random source, which under certain conditions may allow an attacker to predict the expect…

  • High 8.2

    Dancer2 versions before 2.2.0 for Perl generate insecure session ids when required CSPRNG modules are unavailable

    Dancer2 versions before 2.2.0 for Perl generate insecure session ids when required CSPRNG modules are unavailable. Dancer2::Core::Role::SessionFactory::generate_id silently falls back to a built-in rand-derived session id unless both Math::Random::ISAAC::XS a…

  • Critical 9.8

    Crypt::Password versions through 0.28 for Perl generate insecure random values for salts

    Crypt::Password versions through 0.28 for Perl generate insecure random values for salts. These versions use the built-in rand function, which is predictable and unsuitable for cryptography.

  • High 8.1

    Insecure PRNG and Information Exposure in urwid Web Display Backend

    The urwid web display backend (urwid/display/web.py) generates web session identifiers (urwid_id) in Screen.start() by concatenating two random.randrange(10**9) calls that use Python's Mersenne Twister PRNG, which is not cryptographically secure. Each call co…

  • Medium 5.3

    GD::SecurityImage versions through 1.75 for Perl use rand to generate secrets

    GD::SecurityImage versions through 1.75 for Perl use rand to generate secrets. The random method creates the challenge text used for the CAPTCHA by sampling characters from an array using Perl's built-in rand function, and generates a (by default) six-charact…

  • Critical 9.3

    WireGuard Easy Weak Token Generation Information Disclosure via OTL Route

    WireGuard Easy through 15.3.0, fixed in commit 66b292b, contains a cryptographically weak one-time link token generation vulnerability that allows unauthenticated network attackers to recover WireGuard peer credentials by brute-forcing a keyspace of at most 1…

  • Critical 9.8
    CVE-2026-61500 Public exploit

    Rejetto HFS < 3.2.1 Session Forgery via Predictable Signing Key

    Rejetto HFS 3.0.0 through 3.2.0 derives its session-cookie signing key from the non-cryptographic Math.random() generator and discloses outputs of the same generator to unauthenticated clients during login. A remote attacker can collect a small number of logi…

  • High 8.8

    DoLogin Security <= 4.3 - Unauthenticated Authentication Bypass via Insufficient Randomness via 'dologin' Parameter Weak PRNG Token

    The DoLogin Security plugin for WordPress is vulnerable to Authentication Bypass via Insufficient Randomness in all versions up to, and including, 4.3. The vulnerability exists because `dologin\s::rrand()` seeds the Mersenne Twister with `mt_srand((double) mi…

  • Medium 5.9

    CGI::Session::ID::md5 versions before 4.49 for Perl generate predictable session ids from low-entropy sources

    CGI::Session::ID::md5 versions before 4.49 for Perl generate predictable session ids from low-entropy sources. The generate_id method builds the session id from a MD5 digest of the process id, the epoch time, and the built-in rand() function. All three are pr…

  • High 7.4

    UltraVNC MS-Logon II uses 64-bit Diffie-Hellman and seeded libc rand() enabling credential interception

    UltraVNC through 1.8.2.2 uses inadequate cryptography in the MS-Logon II authentication scheme (rfbUltraVNC_MsLogonIIAuth). In rfb/dh.cpp the Diffie-Hellman key exchange is performed with parameters that fit in an unsigned 64-bit integer (DH_MAX_BITS controls…