T08 · Insecure Dependencies
Warning
- Location
- scripts/package-loader.mjs:142
- Finding
- Mutable HyperFrames Packages Can Be Downloaded and Executed Through the Bootstrap Fallback## Vulnerability Details **File Location**: `scripts/package-loader.mjs:142-158`, `scripts/package-loader.mjs:287-328`, and `scripts/package-loader.mjs:383-415` **Vulnerability Type**: Mutable third-party package retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```js export function hyperframesPackageSpec(packageName) { const override = process.env[VERSION_OVERRIDE_ENV]?.trim(); if (override) return `${packageName}@${override}`; const version = readBundledHyperframesVersion(); if (version) return `${packageName}@${version}`; // Global skill installs have no hyperframes package.json // in their ancestor chain, so the bundled version is unknowable. Fall back to // @latest instead of throwing: already-installed packages still import, and a // bootstrap install can still proceed (@latest satisfies the pinned-spec guard). process.stderr.write( [ `hyperframes: could not determine the bundled version for ${packageName}; using @latest.`, `Set ${VERSION_OVERRIDE_ENV}=<version> to pin it.`, "", ].join("\n"), ); return `${packageName}@latest`; } ``` ```js function bootstrapWithNpmInstall(packageNames) { const installRoot = mkdtempSync(join(tmpdir(), "hyperframes-skill-deps-")); const npmArgs = [ "install", "--silent", "--no-audit", "--no-fund", "--ignore-scripts", "--no-save", "--prefix", installRoot, ...packageNames, ]; const npmCommand = resolveNpmSpawnCommand(npmArgs); if (!npmCommand) { rmSync(installRoot, { recursive: true, force: true }); throw new Error("Could not locate npm-cli.js for dependency bootstrap on Windows."); } const installResult = spawnSync(npmCommand.cmd, npmCommand.args, npmCommand.opts); if (installResult.error) throw installResult.error; if (installResult.status !== 0) { rmSync(installRoot, { recursive: true, force ...[truncated 3101 chars]
- Remediation
- ## Remediation Suggestions - Reject `latest`, npm distribution tags, version ranges, Git URLs, aliases, and other mutable package specifications. - Require an exact semantic version for every bootstrapped package. - Pin package integrity using a lockfile and verified npm integrity hashes. - Fail closed when the bundled version cannot be determined instead of falling back to `@latest`. - Validate `HYPERFRAMES_SKILL_PKG_VERSION` against an exact-version format before constructing a package specification. - Preserve the existing interactive confirmation, temporary installation directory, `--ignore-scripts`, and no-shell subprocess invocation. - Where feasible, distribute reviewed helper packages with the Skill or require users to install them independently through their normal locked dependency workflow.
