T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:10
- Finding
- Unpinned Third-Party SDK Is Dynamically Executed with Workspace Privileges<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:10`; related execution in `scripts/query.mjs:27-29` **Vulnerability Type**: Supply-chain exposure through an unpinned runtime dependency **Risk Level**: Medium ### Vulnerable Code `SKILL.md:10`: ```bash npm i basecred-sdk ``` `scripts/query.mjs:27-29`: ```js // Dynamic import so ESM resolution hits the right node_modules const sdkPath = path.join(WORKSPACE, 'node_modules', 'basecred-sdk', 'dist', 'index.js'); const { getUnifiedProfile } = await import(sdkPath); ``` ### Technical Analysis The installation instruction does not specify an exact, audited version of `basecred-sdk`, and the project does not contain a lockfile or integrity constraint. Consequently, the package version installed when a user follows the documented workflow can change after this Skill has been reviewed. The script subsequently imports the dependency's compiled entry point directly into the running Node.js process. Package initialization code and the exported `getUnifiedProfile` implementation therefore execute with the same filesystem, environment, user, and network privileges as the Skill. The SDK source is not included in the audited artifact, so its internal network destinations and handling of credentials cannot be independently verified here. This finding does not establish that the current SDK is malicious. It identifies a supply-chain boundary that permits a compromised or unexpectedly modified future package release to execute arbitrary code. ### Attack Path 1. A user follows the documented instruction and runs `npm i basecred-sdk`. 2. npm resolves a mutable package version because no exact version or project lockfile is specified. 3. An attacker compromises the package, its maintainer account, or a release process and publishes a malicious version. 4. The user invokes `scripts/query.mjs`. 5. The script locates and dynamically imports `basecred-sdk/dist/index.js`. 6. Malicious initialization or query code ...[truncated 880 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `basecred-sdk` to a reviewed exact version rather than installing the latest matching registry release. 2. Add and commit a package manifest and lockfile, then use `npm ci` in documented and automated workflows. 3. Enforce package integrity and provenance verification where supported. 4. Review the pinned SDK source, including initialization behavior, network destinations, and credential handling. 5. Keep automated dependency updates subject to security review and testing before deployment. 6. Consider executing the SDK in an isolated child process or restricted container. 7. If process isolation is used, provide only the wallet address and service-specific credentials required for the query, and restrict filesystem and network access to the minimum necessary. ]]>
