T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Automatic Execution of an Unpinned npm Package
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:13, 53-54;references/mcp-config.example.json:4-8;SKILL.md:72, 111-116
Vulnerability Type:T08: Insecure Dependencies
Risk Level: HighThe project downloads and executes the mutable
latestrelease of an npm package without a lockfile, integrity hash, or installation confirmation.Vulnerable Code
From
scripts/imiva_mcp.py:python PACKAGE = "@infimind/ecom-content-cli@latest" DEFAULT_API_URL = "https://imiva.ecpro.com"python proc = subprocess.Popen( [npx, "-y", PACKAGE], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1, env=env, )From
references/mcp-config.example.json:json { "mcpServers": { "imiva-ecommerce": { "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" } } } }The same unsafe runtime dependency pattern is recommended in
SKILL.md:json { "mcpServers": { "imiva-ecommerce": { "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" } } } }Technical Analysis
The
@latestnpm tag is mutable and does not identify a reproducible, previously reviewed package artifact. The-yoption instructsnpxto proceed without requesting installation confirmation. Consequently, each invocation can download and execute whatever package version the publisher currently assigns tolatest.The downloaded package runs as a subprocess with the invoking user's permissions. It also receives a copy of the parent pro ...[truncated 2290 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@infimind/ecom-content-cli@latestwith a specific, reviewed version in the Python helper, example configuration, and documentation. - Install the dependency during a controlled setup or build step rather than downloading it on every invocation.
- Commit an npm lockfile and use a reproducible installation command such as
npm ci. - Verify package integrity using the lockfile integrity value, a trusted artifact checksum, or package-signature/provenance controls.
- Remove automatic runtime installation through
npx -y. Invoke a locally installed, version-controlled executable instead. - Review dependency changes before upgrading and use automated vulnerability, provenance, and package-maintainer monitoring.
- Construct a minimal subprocess environment instead of passing
os.environ.copy(). Include only variables required by the MCP package. - Scope the MCP token to the minimum required permissions and usage limits. Support prompt revocation and rotation if compromise is suspected.
- Where feasible, isolate the MCP process in a sandbox or container with restricted filesystem and network access.
- Replace
