T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Automatic Execution of an Unpinned npm Package
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:14, 49-60; additional occurrences inSKILL.md:78, 105-106andreferences/mcp-config.example.json:5-6
Vulnerability Type: Supply-chain risk caused by remote retrieval and execution of a mutable dependency
Risk Level: HighVulnerable Code
python PACKAGE = "@infimind/ecom-content-cli@latest"python npx, token = require_runtime() 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, )The bundled example configuration also recommends the same behavior:
json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ]Technical Analysis
The helper invokes
npxwith the-yoption and the mutable package specifier@infimind/ecom-content-cli@latest. This causes npm to retrieve and execute whichever package version the registry identifies aslatestat invocation time, without an interactive installation confirmation.Consequently, the code actually executed is not contained in or fixed by this audited project. It can change after the project has been reviewed. A compromised package maintainer account, malicious future release, registry compromise, or defective package update could therefore introduce arbitrary behavior into subsequent Skill executions.
The external package inherits a copy of the parent process environment. This explicitly includes
MCP_TOKENandAPI_URL, as well as any other variables present inos.environ. The package also runs with the operating-system privileges of the user invoking the Skill.Attack Path
- An attacker compromises the npm package publisher, publishing pipe ...[truncated 1592 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace
@latestwith an exact, reviewed package version, for example:python PACKAGE = "@infimind/ecom-content-cli@1.2.3" -
Use a lockfile and npm integrity metadata to ensure that installation resolves to the expected artifact. Where operationally possible, install the dependency during a controlled deployment step rather than downloading it every time the Skill runs.
-
Mirror approved package artifacts in a controlled internal registry and restrict package resolution to that registry.
-
Establish an explicit upgrade process in which new package versions are reviewed, integrity-checked, tested, and approved before changing the pinned version.
-
Replace
os.environ.copy()with a minimal environment containing only variables required for execution. Avoid exposing unrelated credentials or configuration to the child process. -
Run the MCP package under a sandboxed, least-privileged account or container with restricted filesystem and network access.
-
Update
SKILL.mdandreferences/mcp-config.example.jsonto use the same exact approved version instead of@latest. -
Consider disabling automatic npm lifecycle scripts where compatible, and monitor package provenance, signatures, checksums, and publisher changes.
-
