T08 · Insecure Dependencies
- Location
SKILL.md:62- Finding
Unpinned Runtime Dependency Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 62-74
Vulnerability Type: Supply-chain risk from unpinned runtime package execution
Risk Level: MediumVulnerable Code
json { "mcpServers": { "clawnet": { "command": "npx", "args": ["tsx", "src/mcp/server.ts"], "env": { "CLAWNET_API_KEY": "your_key", "CLAWNET_BASE_URL": "https://api.claw-net.org" } } } }Technical Analysis
The documented MCP configuration launches
tsxthroughnpxwithout specifying an exact package version. Iftsxis not already available locally,npxmay retrieve and execute it from the configured npm registry at runtime. The project provides no dependency manifest, lockfile, integrity hash, or vendored reviewed copy that constrains the executed package.Consequently, the code ultimately executed by this configuration can differ from the code reviewed during the audit. A compromised registry account, malicious package release, unsafe registry configuration, or unexpected upstream update could introduce arbitrary code.
The child process also receives
CLAWNET_API_KEYthrough its environment. Any malicious code executed during package resolution or startup could read and disclose that credential. The referencedsrc/mcp/server.tsis absent from the audited project, so the MCP procedure is not self-contained and cannot be fully verified from the supplied artifact.Attack Path
- A user copies the documented MCP configuration into a supported client.
- The client starts the configured server by executing
npx tsx src/mcp/server.ts. - The required package is unavailable locally, causing
npxto resolve or download it from the configured npm registry. - An attacker-controlled or compromised package version is selected because no exact version or integrity constraint is present.
- Package installation or startup code executes with the user's local privileges.
- The malicious code reads i ...[truncated 629 chars]
- Remediation
View remediation
Remediation Suggestions
- Add a dependency manifest and lockfile to the project, and pin
tsxto a reviewed exact version. - Install dependencies explicitly during a controlled setup step rather than allowing
npxto acquire packages when the MCP server starts. - Invoke the locked local binary, such as
node_modules/.bin/tsx, with runtime package downloads disabled. - Enforce the official npm registry and use lockfile integrity metadata during installation.
- Ship the referenced
src/mcp/server.tsin the audited artifact so users can review the complete execution path. - Run the MCP server in a restricted environment with minimal filesystem and network permissions.
- Provide the API key only to reviewed application code and avoid exposing unrelated secrets through the child process environment.
- Add automated dependency scanning and verify package provenance before releases.
- Add a dependency manifest and lockfile to the project, and pin
