T03 · Remote Payload Retrieval and Execution
- Location
scripts/imiva_mcp.py:13- Finding
Mutable npm Package Is Downloaded and Executed at Runtime
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:13, 52-53;references/mcp-config.example.json:4-8;SKILL.md:110-115
Vulnerability Type: Runtime execution of an unpinned third-party dependency
Risk Level: HighVulnerable Code
scripts/imiva_mcp.py:python PACKAGE = "@infimind/ecom-content-cli@latest"python 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: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" } } } }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 helper launches
npxwith the-yoption and the mutable package selector@latest. This permits npm to download and execute whichever package release is currently associated with thelatestdistribution tag. Consequently, the effective executable payload can change after this project has been reviewed.The downloaded package runs with the privileges of the user executing the helper. It also receives a copied process environment containing
MCP_TOKENandAPI_URL. A compromised npm publisher account, malicious future package version, or registry compromise could therefore introduce arbitrary code without any corresponding change to this repository.This is both remote ...[truncated 1419 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed package version, for example@infimind/ecom-content-cli@1.2.3. - Install the dependency during a controlled build or deployment phase rather than downloading it on each invocation.
- Use a lockfile and verify npm integrity hashes. Enforce reproducible installation with
npm ci. - Verify package provenance, publisher identity, signatures, and release attestations before updating.
- Introduce an explicit dependency-update process that includes source review, malware scanning, and regression testing.
- Run the MCP package in a sandbox with restricted filesystem and network access.
- Supply only the environment variables required by the child process rather than copying the complete parent environment.
- Update
SKILL.md, the example MCP configuration, and the Python constant together so all invocation paths use the same pinned version.
- Replace
