T09 · Insecure Skill Coding Practices
- Location
SKILL.md:119- Finding
Predictable Cryptographic Seed in Primary Usage Example
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 119–122
Vulnerability Type: Predictable cryptographic key derivation caused by a hardcoded low-entropy seed
Risk Level: HighVulnerable Code
typescript const keys = await UserShareEncryptionKeys.fromRootSeedKey( new TextEncoder().encode('your-seed'), Curve.SECP256K1, );Technical Analysis
The example passes the fixed string
your-seeddirectly intoUserShareEncryptionKeys.fromRootSeedKey. Because this key-derivation operation is deterministic, every application that copies the example without replacing the placeholder will derive the same encryption and signing key material.The documentation does not enforce minimum entropy, generate a random seed, or place an immediate warning beside the example. Although the value is presented as a placeholder, the surrounding code is directly executable, creating a realistic risk that developers will retain it during testing or deployment.
This constitutes an insecure cryptographic default. An attacker does not need to recover the seed through brute force because it is publicly documented.
Attack Path
- A developer copies the shared-dWallet example into an application.
- The developer runs or deploys it without replacing
your-seed. - The application deterministically creates the documented
UserShareEncryptionKeys. - An attacker independently derives the same keys using the public example.
- The attacker uses the duplicated key identity and decryption material against associated protocol records and encrypted user shares where accessible.
- Depending on the wallet mode, capabilities, and protocol state, this may permit impersonation, decryption of user-share material, or unauthorized participation in wallet operations.
Impact Assessment
The affected material includes the class-groups decryption key and the signing identity derived by
UserShareEncryptionKeys...[truncated 616 chars]- Remediation
View remediation
Remediation Suggestions
-
Replace the fixed string with cryptographically secure random seed generation using at least 32 bytes:
typescript import { randomBytes } from 'node:crypto'; const rootSeed = new Uint8Array(randomBytes(32)); const keys = await UserShareEncryptionKeys.fromRootSeedKey( rootSeed, Curve.SECP256K1, ); -
Store the generated seed in a dedicated secret manager, hardware-backed keystore, or encrypted application vault.
-
Never commit the seed to source control, logs, examples, browser storage, or configuration files.
-
Add a prominent warning immediately above every seed-derivation example stating that placeholder and human-readable seeds must never be used.
-
Validate seed length and provenance in surrounding application code, rejecting known placeholders and low-entropy inputs.
-
Where deterministic recovery is required, use a documented password-based KDF with a unique salt and appropriate work factor rather than passing a human-readable password directly.
-
Rotate any keys created from this documented placeholder and migrate affected dWallets according to the protocol’s secure recovery or transfer procedure.
-
