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

  • High 8.6
    CVE-2021-43799 Public exploit

    RabbitMQ exposes ports with weak default secrets in Zulip Server

    Zulip is an open-source team collaboration tool. Zulip Server installs RabbitMQ for internal message passing. In versions of Zulip Server prior to 4.9, the initial installation (until first reboot, or restart of RabbitMQ) does not successfully limit the defau…

  • Medium 6.5

    Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in star7th/showdoc

    showdoc is vulnerable to Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

  • Unscored —

    PolarSSL versions prior to v1.1 use the HAVEGE random number generation algorithm. At its heart, this uses timing infor…

  • Medium 4.2

    PAN-OS: Weak Cryptography Used in Web Interface Authentication

    A cryptographically weak pseudo-random number generator (PRNG) is used during authentication to the Palo Alto Networks PAN-OS web interface. This enables an authenticated attacker, with the capability to observe their own authentication secrets over a long du…

  • High 8.1

    Use of Predictable Algorithm in Random Number Generator in yiisoft/yii2

    yii2 is vulnerable to Use of Predictable Algorithm in Random Number Generator

  • High 7.5

    Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in star7th/showdoc

    showdoc is vulnerable to Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

  • Unscored —

    Eclipse TinyDTLS through 0.9-rc1 relies on the rand function in the C library, which makes it easier for remote attacke…

  • Critical 9.8

    go.uuid has Predictable UUID Identifiers

    A flaw was found in github.com/satori/go.uuid in versions from commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c to d91630c8510268e75203009fe7daf2b8e1d60c45. Due to insecure randomness in the g.rand.Read function the generated UUIDs are predictable for an attac…

  • Unscored —
    CVE-2008-3280 Public exploit

    It was found that various OpenID Providers (OPs) had TLS Server Certificates that used weak keys, as a result of the De…

  • Medium 5.1

    Improper random number generation in nanorand

    An issue was discovered in the nanorand crate before 0.5.1 for Rust. It caused any random number generator (even ChaCha) to return all zeroes because integer truncation was mishandled.

  • High 7.5

    Use of Cryptographically Weak Pseudo-Random Number Generator in Rclone

    An issue was discovered in Rclone before 1.53.3. Due to the use of a weak random number generator, the password generator has been producing weak passwords with much less entropy than advertised. The suggested passwords depend deterministically on the time th…

  • Medium 5.9

    miekg/dns insecurely generates random numbers

    The miekg Go DNS package before 1.1.25, as used in CoreDNS before 1.6.6 and other products, improperly generates random numbers because math/rand is used. The TXID becomes predictable, leading to response forgeries.

  • Medium 5.3

    Magento 2 Community Weak PRNG

    Magento 2.2 prior to 2.2.10, Magento 2.3 prior to 2.3.3 or 2.3.2-p1 uses cryptographically weak random number generator to brute-force the confirmation code for customer registration.

  • Medium 4.9

    Use of Cryptographically Weak Pseudo-Random Number Generator in org.pac4j:pac4j-saml

    The SAML identifier generated within SAML2Utils.java was found to make use of the apache commons-lang3 RandomStringUtils class which makes them predictable due to RandomStringUtils PRNG's algorithm not being cryptographically strong. This issue only affects t…

  • High 8.1

    Use of Insufficiently Random Values in Apereo CAS

    Multiple classes used within Apereo CAS before release 6.1.0-RC5 makes use of apache commons-lang3 RandomStringUtils for token and ID generation which makes them predictable due to RandomStringUtils PRNG's algorithm not being cryptographically strong.

  • Critical 9.8

    JHipster Kotlin using insecure source of randomness `RandomStringUtils` before v1.2.0

    A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password rese…

  • High 7.5

    Magento 2 Community Edition Weak PRNG

    A cryptographically weak pseudo-rando number generator is used in multiple security relevant contexts in Magento 2.1 prior to 2.1.18, Magento 2.2 prior to 2.2.9, Magento 2.3 prior to 2.3.2.

  • Medium 5.3

    Magento 2 Community Cryptographic Flaw

    A cryptograhic flaw in Magento 2.1 prior to 2.1.18, Magento 2.2 prior to 2.2.9, Magento 2.3 prior to 2.3.2 could be abused by an unauthenticated user to discover an invariant used in gift card generation.

  • Unscored —

    Use of cryptographically weak PRNG in the password recovery token generation of Revive Adserver < v4.2.1 causes a poten…

  • Medium —

    Cryptographically Weak PRNG in generate-password

    Affected versions of generate-password generate random values that are biased towards certain characters depending on the chosen character sets. This may result in guessable passwords. ## Recommendation Update to version 1.4.1 or later.

  • High 7.5

    matrix-sydent and matrix-synapse Use Cryptographically Weak PRNG

    An issue was discovered in Matrix Sydent before 1.0.3 and Synapse before 0.99.3.1. Random number generation is mishandled, which makes it easier for attackers to predict a Sydent authentication token or a Synapse random ID.

  • Low 3.7

    Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in Ratpack

    Ratpack versions before 1.6.1 generate a session ID using a cryptographically weak PRNG in the JDK's ThreadLocalRandom. This means that if an attacker can determine a small window for the server start time and obtain a session ID value, they can theoretically…

  • High 8.1

    CredHub Service Broker uses guessable client secret

    Pivotal CredHub Service Broker, versions prior to 1.1.0, uses a guessable form of random number generation in creating service broker's UAA client. A remote malicious user may guess the client secret and obtain or modify credentials for users of the CredHub S…

  • Critical 9.1

    Cryptographically Weak Pseudo-Random Number Generator (PRNG) in akka-actor

    Lightbend Akka 2.5.x before 2.5.16 allows message disclosure and modification because of an RNG error. A random number generator is used in Akka Remoting for TLS (both classic and Artery Remoting). Akka allows configuration of custom random number generators.…

  • Medium 5.3

    Cryptographically Weak PRNG in randomatic

    react-native-meteor-oauth is a library for Oauth2 login to a Meteor server in React Native. The oauth Random Token is generated using a non-cryptographically strong RNG (Math.random()).

  • High 7.5

    The Bitcoin Proof-of-Work algorithm does not consider a certain attack methodology related to 80-byte block headers wit…

  • High 7.8

    OleumTech WIO Use of Cryptographically Weak Pseudo-Random Number Generator

    OleumTech WIO DH2 Wireless Gateway and Sensor Wireless I/O Modules rely exclusively on a time value for entropy in key generation, which makes it easier for remote attackers to defeat cryptographic protection mechanisms by predicting the time of project creat…

  • Medium —

    Apache Syncope uses a weak PNRG

    Apache Syncope 1.1.x before 1.1.8 uses weak random values to generate passwords, which makes it easier for remote attackers to guess the password via a brute force attack.