agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`
Internet Computer agent-js
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @dfinity/identity npm |
|
|
| @dfinity/auth-client npm |
|
|
Internet Computer agent-js
| Product | Affected | Fixed in |
|---|---|---|
| @dfinity/identity npm |
|
|
| @dfinity/auth-client npm |
|
|
Impact: The library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an optional param to provide a 32 byte seed value, which will then be used as the secret key. When no seed value is provided, it is expected that the library generates the secret key using secure randomness. However, a recent change broke this guarantee and uses an insecure seed for key pair generation. Since the private key of this identity (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe) is compromised, one could lose funds associated with the principal on ledgers or lose access to a canister where this principal is the controller.
From the CVE record · Dfinity
When Ed25519KeyIdentity.generate is called without a seed, affected packages use an insecure seed instead of secure randomness to generate the private key. The resulting identity is compromised; funds associated with its principal could be lost, or access to a canister it controls could be lost. The input does not specify network access, authentication, or user-interaction requirements.
Check applications using npm @dfinity/identity or @dfinity/auth-client versions >=0.20.0-beta.0 and <1.0.1.