T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Automatic Execution of an Unpinned npm Package
- Content
View full analysis
Vulnerability Details
File Locations:
scripts/imiva_mcp.py:13scripts/imiva_mcp.py:50-59references/mcp-config.example.json:4-8SKILL.md:111-116
Vulnerability Type: Unpinned third-party dependency with automatic download and execution
Risk Level: MediumVulnerable Code
scripts/imiva_mcp.py:13:python PACKAGE = "@infimind/ecom-content-cli@latest"scripts/imiva_mcp.py:50-59: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, bufsize=1, env=env, )references/mcp-config.example.json:4-8:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ],SKILL.md:111-116:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ],Technical Analysis
The Skill invokes
@infimind/ecom-content-cli@latestthroughnpx -y. Thelatestnpm tag is mutable and may resolve to a different package release each time the Skill is used. The-yoption automatically approves package installation, allowing the resolved package to be downloaded and executed without an interactive review.The project does not provide an exact package version, lockfile, package integrity hash, or vendored and reviewed implementation. Therefore, the code that executes at runtime is not necessarily the code that existed when this Skill was audited.
The Python helper also constructs the child-process environment using
os.environ.copy(). As a result, the downloaded package receives the complete inherited environment, includingMCP_TOKENand potentially unrelated credentials or sensitive configuration present in the parent process....[truncated 2002 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace
@infimind/ecom-content-cli@latestwith a reviewed, exact version, for example:python PACKAGE = "@infimind/ecom-content-cli@1.2.3"Apply the same exact version in
SKILL.mdandreferences/mcp-config.example.json. -
Do not download dependencies automatically during normal Skill execution. Install the reviewed package through a separate, explicit setup process and invoke the installed binary afterward.
-
Use a lockfile and npm integrity metadata. Commit the lockfile to the repository and perform installations with a reproducible command such as
npm ci. -
Verify package provenance and integrity before execution. Where supported, require registry signatures, trusted publisher metadata, or an expected package archive hash.
-
Replace
os.environ.copy()with a minimal environment containing only the variables required by the MCP process. For example:python env = { "PATH": os.environ.get("PATH", ""), "MCP_TOKEN": token, "API_URL": os.environ.get( "IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL), ), } -
Run the MCP package with least privilege in an isolated environment or container. Restrict filesystem access, outbound network destinations, and access to unrelated user credentials.
-
Establish a controlled update process in which new package versions are reviewed, tested, and explicitly pinned before deployment.
-
Rotate
MCP_TOKENand audit service activity if an untrusted or unexpected package version may already have been executed.
-
