T08 · Insecure Dependencies
- Location
scripts/research.sh:105- Finding
Automatic Execution of an Unpinned npm Package
- Content
View full analysis
Vulnerability Details
File Location:
scripts/research.sh, line 105
Vulnerability Type: Runtime supply-chain exposure through an unpinned dependency
Risk Level: MediumVulnerable Code:
bash npx -y mcp-remote https://mcp.tavily.com/mcp </dev/null >/dev/null 2>&1 &Technical Analysis
When no Tavily credential is available, the script invokes
npx -y mcp-remotewithout specifying an exact reviewed package version or enforcing package integrity. The-yoption automatically approves package installation and execution.Consequently, package code and applicable installation lifecycle scripts retrieved from the npm registry execute with the permissions of the user running the skill. The effective executable payload can change after the skill itself has been audited. A compromised package release, transitive dependency, npm account, or registry resolution path could therefore introduce arbitrary code without requiring any modification to this repository.
Attack Path
- An attacker compromises the
mcp-remotepackage, one of its dependencies, or its package publishing infrastructure. - The attacker publishes a malicious version or injects malicious installation/runtime behavior.
- A user runs the research skill without
TAVILY_API_KEYand without a usable cached Tavily token. - The authentication fallback reaches line 105 and uses
npx -yto retrieve and execute the currently resolved package. - The malicious package code executes locally under the invoking user's account.
Impact Assessment
Successful exploitation provides arbitrary code execution with the privileges of the user invoking the skill. The malicious dependency could read or modify files accessible to that user, access environment variables and local credentials, tamper with Agent resources, initiate network connections, or modify subsequent command execution.
The scope is limited by the invoking a ...[truncated 153 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Pin
mcp-remoteto an exact, reviewed version rather than resolving the latest available release at runtime. - Install dependencies through a committed lockfile containing integrity hashes.
- Avoid downloading and executing packages during normal skill operation. Prefer a preinstalled, audited OAuth client or vendor the minimal reviewed implementation.
- Disable or tightly control dependency lifecycle scripts where operationally possible.
- Verify package provenance and integrity before execution.
- Run the OAuth helper with restricted filesystem, environment, and network access.
- Fail safely with explicit installation instructions if the reviewed dependency is unavailable rather than automatically retrieving executable code.
- Pin
