CVE-2024-1631agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`
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.
What to do
Fixed builds are available from npm: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| npm library | @dfinity/auth-client | Fixed | 1.0.1 | GHSA-c9vv-fhgv-cjc3 |
| npm library | @dfinity/identity | Fixed | 1.0.1 | GHSA-c9vv-fhgv-cjc3 |
What the vendor says
As published in the CVE record by Dfinity, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Internet Computer agent-js: affected: v0.20.0-beta.0 to before v1.0.1; fixed in
v1.0.1
References
- https://github.com/dfinity/agent-js/pull/851
- https://www.npmjs.com/package/@dfinity/identity/v/1.0.1
- https://github.com/dfinity/agent-js
- https://agent-js.icp.xyz/identity/index.html
- https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.