T08 · Insecure Dependencies
Warning
- Location
- scripts/crawl.sh:105
- Finding
- Automatic Execution of an Unpinned npm Package<![CDATA[ ## Vulnerability Details **File Location**: `scripts/crawl.sh`, lines 105-112 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash if [ -z "$TAVILY_API_KEY" ]; then set +e echo "No Tavily token found. Initiating OAuth flow..." >&2 echo "Please complete authentication in your browser..." >&2 npx -y mcp-remote https://mcp.tavily.com/mcp </dev/null >/dev/null 2>&1 & MCP_PID=$! ``` ### Technical Analysis When no Tavily credential is available, the script invokes `npx -y mcp-remote` without specifying an exact package version or validating package integrity. The `-y` option suppresses the normal installation confirmation. Consequently, npm may download and execute whichever version of `mcp-remote` is currently resolved by the configured registry. The effective executable code is therefore not contained in, pinned by, or auditable from this project. A compromised package release, npm maintainer account, transitive dependency, package registry, or local npm registry configuration could cause arbitrary code to execute during authentication. This behavior is triggered automatically as part of the documented first-run workflow. ### Attack Path 1. The user invokes `scripts/crawl.sh` without setting `TAVILY_API_KEY`, and no acceptable cached Tavily token is found. 2. The script reaches the OAuth branch. 3. `npx -y` resolves and, if necessary, downloads the current `mcp-remote` package and its dependencies. 4. npm executes package-controlled code without interactive confirmation. 5. If the resolved package or dependency is malicious or compromised, that code executes with the permissions and environment of the user running the Skill. 6. The malicious code may access files, credentials, environment variables, or network resources available to that user. ### Impact Assessment Successful exploitation provides arbitrary code execution with the invoking user's privileges. The ...[truncated 302 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin `mcp-remote` to a reviewed exact version rather than resolving the latest available release. - Manage the package through a committed lockfile containing integrity hashes. - Install dependencies during a controlled setup phase instead of dynamically downloading executable code during normal Skill operation. - Require explicit user approval before installing or executing a package that is not already present. - Prefer distributing an audited local dependency or invoking a preinstalled binary whose version and checksum have been verified. - Restrict the authentication subprocess's environment and filesystem access where sandboxing is available. - Preserve subprocess output or provide securely sanitized diagnostics rather than suppressing all output, so unexpected installation behavior can be investigated. ]]>
