{"answers":{"affected":"4 open source packages ship an affected version, including @dfinity/auth-client and @dfinity/identity. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-1631 in the wild and no public exploit code.","fix":"Upgrade @dfinity/auth-client to 1.0.1 or later.","what":"CVE-2024-1631 is a critical vulnerability in Internet Computer agent-js, published on 21 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-1631 and fix it if it is affected.\n\nWhat it is: CVE-2024-1631 is a critical vulnerability in Internet Computer agent-js, published on 21 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-1631 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @dfinity/auth-client (npm): affected from 0.20.0-beta.0; fixed in 1.0.1\n- @dfinity/auth-client (npm): affected from 0.20.0-beta.0; fixed in 1.0.1\n- @dfinity/identity (npm): affected from 0.20.0-beta.0; fixed in 1.0.1\n- @dfinity/identity (npm): affected from 0.20.0-beta.0; fixed in 1.0.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-1631/ (Markdown: https://insights.sbomify.com/CVE-2024-1631/index.md)","id":"CVE-2024-1631","markdown":"https://insights.sbomify.com/CVE-2024-1631/index.md","name":"CVE-2024-1631","record":{"aliases":["CVE-2024-27084","GHSA-c9vv-fhgv-cjc3"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["account_takeover","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Internet Computer JS library","requires_auth":"none","summary":"Insecure key generation in agent-js allows attackers to compromise private keys, leading to loss of funds or canister control.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Dfinity","cpe":[{"product":"icp-js-core","vendor":"dfinity"}],"cvss":{"score":9.1,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-330","name":"Use of Insufficiently Random Values"},{"id":"CWE-321","name":"Use of Hard-coded Cryptographic Key"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"agent-js: Insecure Key Generation in `Ed25519KeyIdentity.generate`","id":"CVE-2024-1631","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"weak_cryptography","year":"2024"},"n_packages":4,"n_references":5,"next":{"headline":"Incorrect access control in the Sitefinity backend","id":"CVE-2024-1632"},"packages":[{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0.20.0-beta.0"],"last_affected":[],"package":"@dfinity/auth-client","purl":null,"source":"GHSA-c9vv-fhgv-cjc3"},{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0.20.0-beta.0"],"last_affected":[],"package":"@dfinity/auth-client","purl":"pkg:npm/%40dfinity/auth-client","source":"GHSA-c9vv-fhgv-cjc3"},{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0.20.0-beta.0"],"last_affected":[],"package":"@dfinity/identity","purl":null,"source":"GHSA-c9vv-fhgv-cjc3"},{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0.20.0-beta.0"],"last_affected":[],"package":"@dfinity/identity","purl":"pkg:npm/%40dfinity/identity","source":"GHSA-c9vv-fhgv-cjc3"}],"prev":{"headline":"Path traversal in LOGIQ E10","id":"CVE-2024-1630"},"products":["agent-js"],"published":"2024-02-21","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-08-16","vendors":["Internet Computer"]},"summary":"Insecure key generation in agent-js allows attackers to compromise private keys, leading to loss of funds or canister control.","url":"https://insights.sbomify.com/CVE-2024-1631/"}