T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Unpinned npm Package Is Downloaded and Executed with Sensitive Environment Access
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:13,45-53;references/mcp-config.example.json:5-8;SKILL.md:83,106-111
Vulnerability Type: Mutable third-party dependency execution
Risk Level: HighVulnerable Code
scripts/imiva_mcp.py:13python PACKAGE = "@infimind/ecom-content-cli@latest"scripts/imiva_mcp.py:45-53python 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:5-8json "args": [ "-y", "@infimind/ecom-content-cli@latest" ],The same mutable package invocation is also recommended in
SKILL.md:83,106-111.Technical Analysis
The helper invokes
npxwith the-yoption and the mutable dependency specifier@infimind/ecom-content-cli@latest. This permits npm to retrieve and execute whichever package release is associated with thelatestdistribution tag at invocation time. Consequently, the effective executable code can change after this project has been reviewed without any corresponding modification to the audited repository.No exact version, lockfile, package integrity hash, or vendored audited artifact constrains the downloaded code. In addition, the child process receives a copy of the caller's complete environment through
os.environ.copy(), including the explicitly suppliedMCP_TOKENand potentially unrelated credentials held in other environment variables.This finding does not establish that the current npm package is malicious. The vulnerability is the unsafe trust model: a future compromised publisher account, npm registry incident, malicious package update, or compromised upstream releas ...[truncated 1818 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@infimind/ecom-content-cli@latestwith an exact, reviewed version, such as@infimind/ecom-content-cli@X.Y.Z. Do not use version ranges or mutable distribution tags. - Install the dependency during a controlled build or setup phase rather than downloading it whenever the Skill runs.
- Commit and enforce an npm lockfile with integrity metadata. Use
npm ciin a trusted environment so dependency resolution fails when the lockfile and package metadata differ. - Verify package provenance and integrity before release, including publisher identity, registry source, cryptographic integrity, and the complete transitive dependency tree.
- Update the package only through a documented review process that includes source inspection, dependency-diff review, and security testing.
- Replace
os.environ.copy()with a minimal child-process environment. Pass only essential runtime variables such asPATH,MCP_TOKEN, and the intended API URL; omit unrelated credentials. - Run the MCP package in a restricted execution environment with limited filesystem access, network egress controls, and no unnecessary operating-system privileges.
- Update
SKILL.mdandreferences/mcp-config.example.jsonto use the same pinned version so users are not instructed to bypass the hardened implementation. - Consider distributing a pre-reviewed local executable or vendored dependency artifact whose checksum is verified before execution.
- Replace
