Vulnerabilities in pkg:npm/@nfid/embed
PACKAGEGHSA-84c3-j8r2-mcm8 is a CRITICAL (CVSS 9.1) @nfid/embed has compromised private key vulnerability (CWE-321: Use of Hard-coded Cryptographic Key) affecting @nfid/embed libraries in the npm ecosystem. The issue involves @nfid/embed has compromised private key due to @dfinity/auth-client producing insecure session keys. Remediation is available by upgrading affected packages to version 0.10.1-alpha.6.
pkg:npm/@nfid/embed
Vulnerability advisories affecting package pkg:npm/@nfid/embed. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-84c3-j8r2-mcm8 | - | CRITICAL | @nfid/embed has compromised private key due to @dfinity/auth-client producing insecure session keys |
GHSA-84c3-j8r2-mcm8 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix GHSA-84c3-j8r2-mcm8
To remediate this vulnerability, upgrade all affected @nfid/embed dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @nfid/embed@0.10.1-alpha.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @nfid/embed
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-84c3-j8r2-mcm8, inspect your project dependencies using npm:
npm ls @nfid/embed
Analyze the terminal output to locate any version of @nfid/embed in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.1-alpha.6), your application is affected.
Note: The npm ls @nfid/embed command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-321: Use of Hard-coded Cryptographic Key, where the product uses a hard-coded, unchangeable cryptographic key. In @nfid/embed, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-84c3-j8r2-mcm8 Affected @nfid/embed Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@nfid/embed
|
npm |
≥ 0.10.0
< 0.10.1-alpha.6
|
0.10.1-alpha.6
|
References
Frequently Asked Questions
What is GHSA-84c3-j8r2-mcm8?
Which @nfid/embed versions are affected?
What version fixes GHSA-84c3-j8r2-mcm8?
Is @nfid/embed affected?
What is the CVSS score of GHSA-84c3-j8r2-mcm8?
What CWE is associated with GHSA-84c3-j8r2-mcm8?
How can I check npm dependencies for GHSA-84c3-j8r2-mcm8?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-84c3-j8r2-mcm8",
"modified" : "2024-02-26T20:10:10Z",
"published" : "2024-02-26T20:10:10Z",
"aliases" : [ ],
"summary" : "@nfid/embed has compromised private key due to @dfinity/auth-client producing insecure session keys",
"details" : "### Problem\nUser sessions in the @nfid/embed SDK with Ed25519 keys are vulnerable due to a compromised private key `535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe`. This exposes users to potential loss of funds on ledgers and unauthorized access to canisters they control.\n\n### Solution\nUsing version >1.0.1 of @dfinity/auth-client and @dfinity/identity packages, or @nfid/embed >0.10.1-alpha.6 includes patched versions of the issue.\n\nUser sessions will be automatically fixed when they re-authenticate.\n\n### Why this happened\nThe DFINITY auth client library provides a function, `Ed25519KeyIdentity.generate`, for generating an Ed25519 key pair. This function includes an optional parameter to supply a 32-byte seed value, which will be utilized as the secret key. In cases where no seed value is provided, the library is expected to generate the secret key using secure randomness. However, a recent update of DFINITY libraries has compromised this assurance by employing an insecure seed for key pair generation.\n\n### References\n[AgentJS CVE ](https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@nfid/embed"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.10.0"
}, {
"fixed" : "0.10.1-alpha.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3"
}, {
"type" : "WEB",
"url" : "https://github.com/internet-identity-labs/sdk-ts/security/advisories/GHSA-84c3-j8r2-mcm8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/internet-identity-labs/sdk-ts"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-321", "CWE-330" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-26T20:10:10Z",
"nvd_published_at" : null
}
}