T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Unpinned Remote npm Package Is Automatically Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Locations:
scripts/imiva_mcp.py:13scripts/imiva_mcp.py:51-58references/mcp-config.example.json:4-11SKILL.md:108-114
Vulnerability Type: Runtime execution of an unpinned third-party dependency
Risk Level: HighVulnerable Code
scripts/imiva_mcp.py:13:python PACKAGE = "@infimind/ecom-content-cli@latest"scripts/imiva_mcp.py:51-58:python env = os.environ.copy() env["MCP_TOKEN"] = token env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL)) proc = subprocess.Popen( [npx, "-y", PACKAGE], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,references/mcp-config.example.json:4-11:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" }SKILL.md:108-114:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here",Technical Analysis
The Skill invokes
npxwith both the automatic-confirmation option (-y) and the mutable npm version selector@latest. Consequently, each invocation may download and execute package code that differs from the version available when the Skill was audited.No exact package version, lockfile, package integrity hash, or locally verified installation is used. The security of the local execution path therefore depends on the continuing integrity of the npm publisher account, package registry, package release process, and transitive dependency graph.
The downloaded process receives a copy of the complete parent environment through
os.environ.copy(). This environment explicitly includesMCP_TOKENand may also contain unrelated credentials i ...[truncated 1905 chars]- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed package version, for example@infimind/ecom-content-cli@X.Y.Z. - Install dependencies during a controlled build or setup phase rather than downloading them whenever the Skill is invoked.
- Commit and enforce a lockfile, and verify npm integrity metadata or an independently maintained artifact checksum.
- Configure CI to audit package updates before changing the pinned version. Do not permit automated updates to become executable without review.
- Avoid
npx -yfor uninstalled remote packages. Prefer invoking a verified local binary from a controlled dependency directory. - Replace
os.environ.copy()with a minimal environment containing only required runtime variables, such as a controlledPATH,MCP_TOKEN, and the validated API URL. - Run the MCP package in a sandbox with restricted filesystem and network access where the deployment environment supports it.
- Restrict the API endpoint to an approved HTTPS allowlist before forwarding the token, preventing accidental credential transmission to an arbitrary endpoint.
- Rotate the MCP token if an untrusted or subsequently compromised package version may already have been executed.
- Replace
