---
title: "CVE-2024-1631: agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`"
url: https://erroneo.us/security/cve/CVE-2024-1631/
description: "CVE-2024-1631 (@dfinity/identity (npm)): Impact: The library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an…"
type: vulnerability-record
section: "Security Digest"
date_published: 2024-02-21
date_modified: 2026-03-21
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2024-1631"
kev: false
cvss: 9.1
epss: 0.00882
license: All rights reserved. Quote with attribution and a link.
---

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

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.9% , percentile 59: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 59% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes @dfinity/identity (npm) >= 0.20.0-beta.0, < 1.0.1, fixed in 1.0.1 ; @dfinity/auth-client (npm) >= 0.20.0-beta.0, < 1.0.1, fixed in 1.0.1 . Check your lockfile, including transitive dependencies.

## What it is

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.

## Affected packages

- npm `@dfinity/identity` >= 0.20.0-beta.0, < 1.0.1 → fixed: 1.0.1
- npm `@dfinity/auth-client` >= 0.20.0-beta.0, < 1.0.1 → fixed: 1.0.1

## Affected products (CVE record)

- Internet Computer agent-js: v0.20.0-beta.0 < v1.0.1

## Severity

- Dfinity CVSS 3.1: 9.1 `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 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.88% probability of exploitation activity in the next 30 days; percentile 59.

## Sources

- [GitHub Advisory GHSA-c9vv-fhgv-cjc3](https://github.com/advisories/GHSA-c9vv-fhgv-cjc3)
- [CVE.org record CVE-2024-1631](https://www.cve.org/CVERecord?id=CVE-2024-1631)
- [NVD entry CVE-2024-1631](https://nvd.nist.gov/vuln/detail/CVE-2024-1631)
- [github.com](https://github.com/dfinity/agent-js/pull/851)
- [npmjs.com](https://www.npmjs.com/package/@dfinity/identity/v/1.0.1)
- [github.com](https://github.com/dfinity/agent-js)
- [agent-js.icp.xyz](https://agent-js.icp.xyz/identity/index.html)
- [github.com](https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3)

---
Source page: https://erroneo.us/security/cve/CVE-2024-1631/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
