Arama; açıklama metninde, ürün ve üretici adlarında ve açık türlerinde (Türkçe ya da İngilizce, eksik yazımla da) yapılır.

CVE-2021-41117
keypair project keypair

Puan9.1 Kritik
CVSS 3.1
İstismar olasılığı (EPSS)3.2%
önümüzdeki 30 gün içinde
KategoriŞifreleme zayıflığı
Yayımlanma11 Ekim 2021
Son güncelleme: 17 Haziran 2026

Kısaca

Bu açık internet üzerinden, uzaktan, oturum açmadan, kullanıcının bir şey yapmasına gerek kalmadan istismar edilebilir.

Başarılı bir saldırıda ciddi etki: gizli bilgilerin okunması, verilerin değiştirilmesi.

✨ Yapay zekâ yorumu

Kısa bir reklam izledikten sonra bu açığın sade bir dille yorumu gösterilir. Yapay zekâ hata yapabilir; kararlarınızı resmi kaynaklara göre verin.

Resmi açıklama (İngilizce)

keypair is a a RSA PEM key generator written in javascript. keypair implements a lot of cryptographic primitives on its own or by borrowing from other libraries where possible, including node-forge. An issue was discovered where this library was generating identical RSA keys used in SSH. This would mean that the library is generating identical P, Q (and thus N) values which, in practical terms, is impossible with RSA-2048 keys. Generating identical values, repeatedly, usually indicates an issue with poor random number generation, or, poor handling of CSPRNG output. Issue 1: Poor random number generation (`GHSL-2021-1012`). The library does not rely entirely on a platform provided CSPRNG, rather, it uses it's own counter-based CMAC approach. Where things go wrong is seeding the CMAC implementation with "true" random data in the function `defaultSeedFile`. In order to seed the AES-CMAC generator, the library will take two different approaches depending on the JavaScript execution environment. In a browser, the library will use [`window.crypto.getRandomValues()`](https://github.com/juliangruber/keypair/blob/87c62f255baa12c1ec4f98a91600f82af80be6db/index.js#L971). However, in a nodeJS execution environment, the `window` object is not defined, so it goes down a much less secure solution, also of which has a bug in it. It does look like the library tries to use node's CSPRNG when possible unfortunately, it looks like the `crypto` object is null because a variable was declared with the same name, and set to `null`. So the node CSPRNG path is never taken. However, when `window.crypto.getRandomValues()` is not available, a Lehmer LCG random number generator is used to seed the CMAC counter, and the LCG is seeded with `Math.random`. While this is poor and would likely qualify in a security bug in itself, it does not explain the extreme frequency in which duplicate keys occur. The main flaw: The output from the Lehmer LCG is encoded incorrectly. The specific [line][https://github.com/juliangruber/keypair/blob/87c62f255baa12c1ec4f98a91600f82af80be6db/index.js#L1008] with the flaw is: `b.putByte(String.fromCharCode(next & 0xFF))` The [definition](https://github.com/juliangruber/keypair/blob/87c62f255baa12c1ec4f98a91600f82af80be6db/index.js#L350-L352) of `putByte` is `util.ByteBuffer.prototype.putByte = function(b) {this.data += String.fromCharCode(b);};`. Simplified, this is `String.fromCharCode(String.fromCharCode(next & 0xFF))`. The double `String.fromCharCode` is almost certainly unintentional and the source of weak seeding. Unfortunately, this does not result in an error. Rather, it results most of the buffer containing zeros. Since we are masking with 0xFF, we can determine that 97% of the output from the LCG are converted to zeros. The only outputs that result in meaningful values are outputs 48 through 57, inclusive. The impact is that each byte in the RNG seed has a 97% chance of being 0 due to incorrect conversion. When it is not, the bytes are 0 through 9. In summary, there are three immediate concerns: 1. The library has an insecure random number fallback path. Ideally the library would require a strong CSPRNG instead of attempting to use a LCG and `Math.random`. 2. The library does not correctly use a strong random number generator when run in NodeJS, even though a strong CSPRNG is available. 3. The fallback path has an issue in the implementation where a majority of the seed data is going to effectively be zero. Due to the poor random number generation, keypair generates RSA keys that are relatively easy to guess. This could enable an attacker to decrypt confidential messages or gain authorized access to an account belonging to the victim.

CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Açık türü: CWE-335

Etkilenen ürünler

ÜreticiÜrünSürümler
keypair projectkeypair<1.0.4

Kaynaklar

Aynı kategoriden son açıklar

  • CVE-2026-139881 Orta 6.3
    libexpat 2.2.3 through 2.11.0 contains an insufficient entropy vulnerability in writeRandomBytes_dev_urandom() that falls back to a predictable hash salt after short reads. Attackers can craft XML documents with names…
    Şifreleme zayıflığı · 30 Kasım 2026
  • CVE-2026-137021 Yüksek 8.2
    Enclave OS Mini is a Rust-based runtime for confidential applications inside Intel SGX enclaves. Prior to enclave-vaults version 0.33.0, Enclave OS Mini's handle_wrap operation accepted the caller-supplied iv_b64 value…
    Şifreleme zayıflığı · 30 Kasım 2026
  • CVE-2026-81069 Düşük 2.5
    Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains a Use of Insufficiently Random Values vulnerability. A low privileged local attacker could potentially exploit this vulnerability,…
    Şifreleme zayıflığı · 30 Kasım 2026
  • CVE-2026-107967 Düşük 0.9
    HCL Verse for Android included a decryption code for compatibility with locally stored values and attachment files created by older application versions (no longer used for data stored by newer versions). HCL Verse for…
    Şifreleme zayıflığı · 27 Kasım 2026
  • CVE-2026-80509 Düşük 2.5
    Dell Secure Connect Gateway - Virtual Edition, versions prior to 5.36.00.16, contains a Use of a Broken or Risky Cryptographic Algorithm vulnerability. A low privileged local attacker could potentially exploit this…
    Şifreleme zayıflığı · 27 Kasım 2026
  • CVE-2026-137564 Yüksek 8.2
    web-token jwt-framework and jwt-library before 3.4.13, 4.0.x before 4.0.9, 4.1.x before 4.1.11, and 4.2.x before 4.2.6 (and jwt-encryption through 3.2.10) do not check the key length in JWEBuilder and JWEDecrypter for…
    Şifreleme zayıflığı · 26 Kasım 2026