T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:18
- Finding
- Mutable Remote npm Package Is Executed with API-Key Access## Vulnerability Details **File Location**: `SKILL.md:18-36`, `SKILL.md:89-90`, `references/usage-patterns.md:6-15`, `references/usage-patterns.md:92-94`, `scripts/validate.sh:43-45`, `scripts/validate.sh:55-57`, and `scripts/validate.sh:76-78` **Vulnerability Type**: Remote execution of an unpinned third-party dependency with sensitive environment access **Risk Level**: High ### Vulnerable Code `SKILL.md:18-36`: ```markdown - Network access for first-time `@covalenthq/goldrush-mcp-server` package fetch. - A GoldRush API key is available. ## Core Workflow Endpoint candidate inputs before finalizing: - Raw package form from docs: `npx @covalenthq/goldrush-mcp-server@latest` - Reliable non-interactive form: `npx -y @covalenthq/goldrush-mcp-server@latest` - This skill defaults to: - `npx -y @covalenthq/goldrush-mcp-server@latest` 1. Verify protocol/path from official source and probe: - Official source: `https://goldrush.dev/docs/goldrush-mcp-server` - probe candidate endpoint with: - `uxc --inject-env GOLDRUSH_API_KEY=$GOLDRUSH_API_KEY "npx -y @covalenthq/goldrush-mcp-server@latest" -h` 2. Configure credential for repeatable auth: - `uxc auth credential set goldrush-mcp --auth-type bearer --secret-env GOLDRUSH_API_KEY` - `uxc auth credential set goldrush-mcp --auth-type bearer --secret-op op://Engineering/goldrush/api-key` 3. Use fixed link command by default: - `command -v goldrush-mcp-cli` - If missing, create it: - `uxc link goldrush-mcp-cli "npx -y @covalenthq/goldrush-mcp-server@latest" --credential goldrush-mcp --inject-env GOLDRUSH_API_KEY={{secret}}` ``` `references/usage-patterns.md:6-15`: ```bash uxc auth credential set goldrush-mcp --auth-type bearer --secret-env GOLDRUSH_API_KEY command -v goldrush-mcp-cli uxc link goldrush-mcp-cli "npx -y @covalenthq/goldrush-mcp-server@latest" --credential goldrush-mcp --inject-env GOLDRUSH_API_KEY={{secret}} goldrus ...[truncated 3301 chars]
- Remediation
- ## Remediation Suggestions 1. Replace `@latest` with an exact, reviewed package version, such as `@covalenthq/goldrush-mcp-server@X.Y.Z`. 2. Install the dependency through a committed lockfile and enforce package integrity hashes rather than resolving it afresh during each invocation. 3. Remove `npx -y ...@latest` from normal execution. Prefer a separately installed, verified executable or a reproducibly built artifact. 4. Change `scripts/validate.sh` to reject `@latest` and require the approved exact version in both documentation and link commands. 5. Establish a controlled dependency-update process that reviews release changes and lockfile differences before changing the pinned version. 6. Run the MCP server in a sandbox with minimal filesystem access, no unnecessary inherited environment variables, and outbound network access restricted to required GoldRush endpoints where practical. 7. Inject a narrowly scoped API key only for actual API operations. Avoid exposing it during package installation or unauthenticated help/schema discovery if the server supports those operations without credentials. 8. Apply service-side restrictions such as minimum API scopes, usage limits, monitoring, rotation, and rapid revocation procedures.
