T08 · Insecure Dependencies
- Location
- INSTALLATION.md:30
- Finding
- Unpinned npm Package Execution with Access to a Gemini API Key<![CDATA[ ## Vulnerability Details **File Location**: `INSTALLATION.md`, lines 30-46 **Vulnerability Type**: Unpinned third-party package execution with credential exposure **Risk Level**: Medium ### Vulnerable Code ```markdown ### Local Installation (Alternative) If you prefer to run the MCP server locally via npm: ```json { "mcpServers": { "navifare-mcp": { "command": "npx", "args": ["-y", "navifare-mcp"], "env": { "GEMINI_API_KEY": "your-gemini-api-key" } } } } ``` **Note**: Local installation requires a [Google Gemini API key](https://ai.google.dev/) for the format tool's natural language parsing. The hosted service handles this automatically. ``` ### Technical Analysis The local installation executes `npx -y navifare-mcp` without specifying an exact package version or integrity value. Consequently, the code executed on each fresh installation may change after the Skill has been reviewed. The `-y` option suppresses the normal installation confirmation. The resulting package process also receives `GEMINI_API_KEY` through its environment. Any malicious or compromised package release—and potentially malicious dependency code executed during installation or startup—could read that environment variable. This is an insecure supply-chain configuration rather than evidence that the current `navifare-mcp` package is malicious. The risk arises because the instructions do not constrain execution to a previously audited artifact. ### Attack Path 1. An attacker compromises the npm publisher account, package, release process, or a transitive dependency. 2. The attacker publishes a malicious version under the same package name. 3. A user starts or installs the MCP server using the documented configuration. 4. `npx -y navifare-mcp` retrieves and executes the currently resolved package without version or integrity verification. 5. The malicious process reads `GEMINI_API_KEY` from its environment. 6. The process can exf ...[truncated 791 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the package to an exact reviewed version, for example: ```json { "command": "npx", "args": ["-y", "navifare-mcp@1.3.0"] } ``` 2. Prefer a locally installed, reviewed dependency governed by a committed lockfile rather than downloading executable code at startup. 3. Verify npm package integrity metadata and document the expected publisher, version, and package hash. 4. Remove lifecycle scripts where practical, or install with lifecycle scripts disabled after confirming that the package does not require them. 5. Use a dedicated Gemini API key with the minimum required API scope, strict quota limits, billing alerts, and regular rotation. 6. Ensure the MCP process receives only the required environment variables rather than inheriting unrelated credentials. 7. Document a verified update procedure so package upgrades receive security review before deployment. 8. Prefer the hosted MCP option when local package execution and local API-key handling are not required, while clearly documenting the hosted service's data-handling implications. ]]>
