GHSA-84c3-j8r2-mcm8 @nfid/embed has compromised private key due to @dfinity/auth-client producing insecure session keys

Not scored Published

Insecure key generation in DFINITY auth-client allows attackers to compromise user sessions and access funds or canisters.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-84c3-j8r2-mcm8?

GHSA-84c3-j8r2-mcm8 is a vulnerability in @nfid/embed, published on 26 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Problem

User 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.

Solution

Using 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.

User sessions will be automatically fixed when they re-authenticate.

Why this happened

The 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.

References

AgentJS CVE

Which versions are affected by GHSA-84c3-j8r2-mcm8?

2 open source packages ship an affected version, including @nfid/embed.

PackageAffectedFixed in
@nfid/embed npmFrom 0.10.00.10.1-alpha.6
@nfid/embed npmFrom 0.10.00.10.1-alpha.6

How do I fix GHSA-84c3-j8r2-mcm8?

Upgrade @nfid/embed to 0.10.1-alpha.6 or later.

Is GHSA-84c3-j8r2-mcm8 being exploited?

There is no known exploitation of GHSA-84c3-j8r2-mcm8 in the wild and no public exploit code.

Sources

Is GHSA-84c3-j8r2-mcm8 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free