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

55 results · Clear filters · Feed

  • 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.

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • High 7.5

    Crypt::PBKDF2 versions before 0.261630 for Perl generate insecure random values for salts

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

  • High 7.5

    haxtheweb/haxcms-php uses insecure method for generating salt

    HAX CMS helps manage microsite universe with PHP or NodeJs backends. Versions prior to 26.0.1 use `uniqid` for generating salts, which is unsuitable. Version 26.0.1 fixes the issue.

  • High 8.5

    Hardcoded Cryptographic Keys and Weak IV Generation in linqi

    The linqi application contains hardcoded cryptographic keys. Additionally, the application uses a weak algorithm with a limited ASCII charset to dynamically generate Initialization Vectors (IVs) for AES/CBC encryption, making known-plaintext attacks feasible.…

  • High 7.5

    Crypt::PasswdMD5 versions through 1.42 for Perl generates insecure random values for salts

    Crypt::PasswdMD5 versions through 1.42 for Perl generates insecure random values for salts. The built-in rand function is predictable, and unsuitable for cryptography.

  • High 8.7

    RELATE: Predictable Token Generation in auth.py and exam.py

    RELATE is a web-based courseware package. Prior to commit 2f68e16, RELATE is vulnerable to predictable token generation in auth.py's make_sign_in_key() function and exam.py's gen_ticket_code() function. This issue has been patched via commit 2f68e16.

  • High 7.5

    CryptX versions before 0.088 for Perl do not reseed the Crypt::PK PRNG state after forking

    CryptX versions before 0.088 for Perl do not reseed the Crypt::PK PRNG state after forking. The Crypt::PK::RSA, Crypt::PK::DSA, Crypt::PK::DH, Crypt::PK::ECC, Crypt::PK::Ed25519 and Crypt::PK::X25519 modules seed a per-object PRNG state in their constructors …

  • High 7.5

    Apache::API::Password versions through 0.5.2 for Perl can generate insecure random values for salts

    Apache::API::Password versions through 0.5.2 for Perl can generate insecure random values for salts. The _make_salt and _make_salt_bcrypt methods will attept to load Crypt::URandom and then Bytes::Random::Secure to generate random bytes for the salt. If those…

  • High 8.1

    Cloudreve is vulnerable to Account Takeover via Weak Cryptographic Token Generation (Insecure PRNG Seeding)

    Cloudreve is a self-hosted file management and sharing system. Prior to version 4.13.0, the application uses the weak pseudo-random number generator math/rand seeded with time.Now().UnixNano() to generate critical security secrets, including the secret_key, a…

  • High 7.5

    PAGI::Middleware::Session::Store::Cookie versions through 0.001003 for Perl generates random bytes insecurely

    PAGI::Middleware::Session::Store::Cookie versions through 0.001003 for Perl generates random bytes insecurely. PAGI::Middleware::Session::Store::Cookie attempts to read bytes from the /dev/urandom device directly. If that fails (for example, on systems withou…

  • High 8.2

    Apache::SessionX versions through 2.01 for Perl create insecure session id

    Apache::SessionX versions through 2.01 for Perl create insecure session id. Apache::SessionX generates session ids insecurely. The default session id generator in Apache::SessionX::Generate::MD5 returns a MD5 hash seeded with the built-in rand() function, the…

  • High 7.3

    WWW::OAuth 1.000 and earlier for Perl uses insecure rand() function for cryptographic functions

    WWW::OAuth 1.000 and earlier for Perl uses the rand() function as the default source of entropy, which is not cryptographically secure, for cryptographic functions.

  • High 7.7

    Coturn has unsafe nonce and relay port randomization due to weak random number generation.

    coturn is a free open source implementation of TURN and STUN Server. Versions 4.6.2r5 through 4.7.0-r4 have a bad random number generator for nonces and port randomization after refactoring. Additionally, random numbers aren't generated with openssl's RAND_by…

  • High 7.2

    Johnson Controls IQ Panels2, 2+, IQHub, IQPanel 4, PowerG use of Cryptographically Weak Pseudo-Random Number Generator

    Use of a weak pseudo-random number generator, which may allow an attacker to read or inject encrypted PowerG packets.

  • High 7.4

    Jumo: Insufficient entropy in PRNG may lead to root access

    A vulnerability was identified in the password generation algorithm when accessing the debug-interface. An unauthenticated local attacker with knowledge of the password generation timeframe might be able to brute force the password in a timely manner and thus…

  • High 7.5

    Apache::AuthAny::Cookie v0.201 or earlier for Perl generates session ids insecurely

    Apache::AuthAny::Cookie v0.201 or earlier for Perl generates session ids insecurely. Session ids are generated using an MD5 hash of the epoch time and a call to the built-in rand function. The epoch time may be guessed, if it is not leaked from the HTTP Date …

  • High 8.6

    Catalyst::Authentication::Credential::HTTP versions 1.018 and earlier for Perl use insecurely generated nonces

    Catalyst::Authentication::Credential::HTTP versions 1.018 and earlier for Perl generate nonces using the Perl Data::UUID library. * Data::UUID does not use a strong cryptographic source for generating UUIDs. * Data::UUID returns v3 UUIDs, which are generated …

  • High 7.3

    Plack-Middleware-Session before version 0.35 for Perl generates session ids insecurely

    Plack-Middleware-Session before version 0.35 for Perl generates session ids insecurely. The default session id generator returns a SHA-1 hash seeded with the built-in rand function, the epoch time, and the PID. The PID will come from a small set of numbers, a…

  • High 7.0

    Mojolicious::Plugin::CSRF 1.03 for Perl uses a weak random number source for generating CSRF tokens

    Mojolicious::Plugin::CSRF 1.03 for Perl uses a weak random number source for generating CSRF tokens. That version of the module generates tokens as an MD5 of the process id, the current time, and a single call to the built-in rand() function.

  • High 7.7

    Data::Entropy for Perl uses insecure rand() function for cryptographic functions

    Data::Entropy for Perl 0.007 and earlier use the rand() function as the default source of entropy, which is not cryptographically secure, for cryptographic functions.

  • High 7.5

    Admin account takeover through weak Pseudo-Random number generator used in generating password reset codes in langgenius/dify

    A vulnerability in langgenius/dify v0.10.1 allows an attacker to take over any account, including administrator accounts, by exploiting a weak pseudo-random number generator (PRNG) used for generating password reset codes. The application uses `random.randint…

  • High 8.8

    Perl's Crypt::Random module after 1.05 and before 1.56 may use rand() function for cryptographic functions

    Crypt::Random Perl package 1.05 through 1.55 may use rand() function, which is not cryptographically strong, for cryptographic functions. If the Provider is not specified and /dev/urandom or an Entropy Gathering Daemon (egd) service is not available Crypt::Ra…

  • High 7.5

    The Crypt::Random::Source package before 0.13 for Perl has a fallback to the built-in rand() function, which is not a s…

  • High 7.5

    Mateso PasswordSafe through 8.13.9.26689 has Weak Cryptography.

  • High 7.5

    RT-Thread through 5.0.2 generates random numbers with a weak algorithm of "seed = 214013L * seed + 2531011L; return (se…

  • High 7.5

    The Binance Trust Wallet app for iOS in commit 3cd6e8f647fbba8b5d8844fcd144365a086b629f, git tag 0.0.4 misuses the trez…