Skip to content

← Public intelligence

npm package

keypair

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

1 actionable advisory, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 8.7npmAmendedPublished

    Insecure random number generation in keypair

    CVE-2021-41117 · GHSA-3f99-hvg4-qjwj

    Affected
    • npm keypair < 1.0.4
    Fixed in
    1.0.4· Vendor fix available
    Issue
    and Impact A bug in the pseudo-random number generator used by keypair versions up to and including 1.0.3 could allow for weak RSA key generation. This could enable an attacker to decrypt confidential messages or gain authorized access to an account belonging to the victim. We recommend replacing any RSA keys that were generated using keypair version 1.0.3 or earlier. Fix The bug in the pseudo-random number generator is fixed in commit 9596418. If the crypto module is available, it is used instead of the pseudo-random number generator. Also fixed in 9596418 Additional Details The specific line with the flaw is: The definition of putByte is Simplified, this is String.fromCharCode(String.fromCharCode(next & 0xFF)). This results in most of the buffer containing zeros. An example generated buffer: (Note: truncated for brevity) Since it is masking with 0xFF, approximately 97% of the bytes are converted to zeros. The impact is that each byte in the RNG seed has a 97% chance of…

    Recommended action: Upgrade to 1.0.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →