T08 · Insecure Dependencies
Error
- Location
- SKILL.md:23
- Finding
- Unpinned npm Package Is Downloaded and Executed Automatically<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:23-26` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: High ### Vulnerable Code ```yaml mcp_servers: - name: lark-mcp package: "@larksuiteoapi/lark-mcp" source: "https://github.com/larksuite/lark-openapi-mcp" description: "Official Feishu/Lark OpenAPI MCP server — install with: npx -y @larksuiteoapi/lark-mcp mcp -a $LARK_APP_ID -s $LARK_APP_SECRET" ``` The same unsafe installation pattern is repeated at `SKILL.md:32-33` and `SKILL.md:1419`. ### Technical Analysis The documented command uses `npx -y` to retrieve and execute `@larksuiteoapi/lark-mcp` without an exact version, lockfile, or integrity hash. The `-y` option also suppresses the normal installation confirmation. Consequently, the code executed at setup time is determined by the package version resolved from the npm registry at that moment rather than by the content reviewed in this project. Although the package is identified as the official Lark MCP implementation, this project does not cryptographically bind installation to a reviewed artifact. A compromised package release, maintainer account, registry response, or unexpectedly unsafe future release could therefore execute arbitrary code in the local process. The package also receives the Lark application identifier and secret when started, increasing the consequences of dependency compromise. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or the relevant release process. 2. The attacker publishes a modified version under the expected package name. 3. A user follows the Skill documentation and runs the unversioned `npx -y` command. 4. `npx` resolves and downloads the attacker-controlled release without interactive confirmation. 5. Package installation hooks or runtime code execute with the privileges of the invoking user. 6. The malicious package can access the Lark credentials supplied at start ...[truncated 731 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an exact, reviewed version, for example: ```bash npx --yes @larksuiteoapi/lark-mcp@<audited-exact-version> mcp ``` 2. Prefer installing through a project manifest and lockfile rather than resolving the package dynamically during every invocation. 3. Verify package integrity using the package manager's integrity metadata or a separately published cryptographic checksum. 4. Document the expected npm publisher, repository, version, and release checksum so users can verify provenance. 5. Remove automatic confirmation where practical and explain that the command downloads and executes third-party code. 6. Run the MCP server under a dedicated, minimally privileged operating-system account or container. 7. Restrict the Lark application to only the API scopes required for the intended deployment. 8. Review new package versions before updating the pinned version. ]]>
