Unknown · @Dfinity/Identity · CVE-2024-1631
**Name of the Vulnerable Software and Affected Versions**
@dfinity/identity versions prior to 1.0.1
**Description**
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 is compromised, one could lose funds associated with the principal on ledgers or lose access to a canister where this principal is the controller.
**Recommendations**
For versions prior to 1.0.1, upgrade to version 1.0.1 to fix the vulnerability.
As a temporary workaround, consider invoking the function as `Ed25519KeyIdentity.generate(null)` to force the function to generate a securely random seed.
Alternatively, pass a securely generated randomness as a seed to `Ed25519KeyIdentity.generate` to force the library to use it as the seed to generate the key pair.
For users, remove the affected principal as a controller of a canister and create a new identity to manage canisters.
Check funds on wallets or ledgers and transfer them to a new account if the account principal matches the compromised identity.