Skip to content
Heist/ feed
Back to feed
Critical

agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-1631
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 01:06 UTC · Revision 1

Source evidence

agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`

core-osv · Original source

Published 21 Feb 2024, 02:12 UTC

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.

osv:CVE-2024-1631
Complete source record
{
  "id": "5c45517c329d21c10ba2fe792880d0fafcf5d0840992760414ea837a0b4fee4b",
  "url": "https://osv.dev/vulnerability/CVE-2024-1631",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`",
    "summary": "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.",
    "evidence": "osv:CVE-2024-1631",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2024-1631",
      "aliases": [
        "CVE-2024-1631",
        "GHSA-c9vv-fhgv-cjc3"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/dfinity/icp-js-core",
              "type": "GIT",
              "events": [
                {
                  "introduced": "963ef63680440b07a831d429c4fa9aba9ab1a1e9"
                },
                {
                  "fixed": "0f0e10abd6ecf2d118bf7e3d954609a199c62424"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "v0.20.0-beta.0"
                      },
                      {
                        "fixed": "v1.0.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "cpe": "cpe:2.3:a:dfinity:icp-js-core:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0.20.0"
                      },
                      {
                        "fixed": "1.0.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.0.0",
            "v0.21.4",
            "v0.21.3",
            "v0.21.2",
            "v0.21.1",
            "v0.21.0",
            "v0.20.2",
            "v0.20.1",
            "v0.20.0",
            "v0.20.0-beta.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-1631.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.773864900Z",
      "provider": "osv",
      "references": [
        "https://agent-js.icp.xyz/identity/index.html",
        "https://www.npmjs.com/package/@dfinity/identity/v/1.0.1",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/1xxx/CVE-2024-1631.json",
        "https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-1631",
        "https://github.com/dfinity/agent-js/pull/851",
        "https://github.com/dfinity/agent-js"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-321",
          "CWE-330"
        ],
        "cna_assigner": "Dfinity",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/1xxx/CVE-2024-1631.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-1631",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491417,
  "published_at": "2024-02-21T02:12:38.403+00:00"
}