# CVE-2024-1631: agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`

- Severity: Critical 9.1 (CVSS:3.1, scored by Dfinity) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.12%, higher than 66% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-02-21T02:12:38.403Z
- Modified: 2026-07-08T06:53:06.618Z
- Also known as: GHSA-c9vv-fhgv-cjc3
- Weaknesses: CWE-321, CWE-330
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: Dfinity

## Description

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.

(As written by CVE List.)

## Affected

- Internet Computer agent-js: from v0.20.0-beta.0 before v1.0.1
- dfinity agent-js: from v0.20.0-beta.0 before v1.0.1
- @dfinity/identity (npm): from 0.20.0-beta.0 before 1.0.1
- @dfinity/auth-client (npm): from 0.20.0-beta.0 before 1.0.1
- dfinity icp-js-core: from 0.20.0 before 1.0.1

## Every score

- Dfinity: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`

## References

- <https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3> (exploit, vendor-advisory, web)
- <https://github.com/dfinity/agent-js/pull/851> (issue-tracking, patch, web)
- <https://www.npmjs.com/package/@dfinity/identity/v/1.0.1> (product, web)
- <https://github.com/dfinity/agent-js> (package, product)
- <https://agent-js.icp.xyz/identity/index.html> (broken-link, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-1631> (advisory)

## Sources

- CVE List: [CVE-2024-1631](https://www.cve.org/CVERecord?id=CVE-2024-1631), CVE Terms of Use, modified 2024-08-16
- GitHub Advisory Database: [GHSA-c9vv-fhgv-cjc3](https://github.com/advisories/GHSA-c9vv-fhgv-cjc3), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2024-1631](https://nvd.nist.gov/vuln/detail/CVE-2024-1631), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-1631 · Whole record: https://cve.day/CVE-2024-1631.json · Rebuilt by cve.day 2026-11-25T22:58:36.949Z
