T08 · Insecure Dependencies
Error
- Location
- SKILL.md:22
- Finding
- Automatic Execution of an Unpinned Runtime Package## Vulnerability Details **File Location**: `SKILL.md`, lines 22-23 **Vulnerability Type**: Unpinned third-party package retrieval and execution **Risk Level**: High ### Vulnerable Code ```json "command": "npx", "args": ["-y", "tsx", "{baseDir}/mcp-server.ts"], ``` ### Technical Analysis The MCP configuration invokes `npx -y tsx` without specifying a package version. The `tsx` package is also absent from `package.json`, meaning `npx` can retrieve it dynamically from the configured npm registry when the server starts. The `-y` option suppresses the normal installation confirmation. Consequently, the code executed at startup is not fully represented by the audited project. Its effective behavior can change after review because package resolution depends on the registry state, npm configuration, cache state, and available package versions. ### Attack Path 1. An attacker compromises the upstream `tsx` package, its maintainer account, the configured npm registry, or the package-resolution channel. 2. A malicious or otherwise compromised release becomes the version selected by the unpinned `npx` invocation. 3. The user starts the MCP server according to the documented configuration. 4. `npx -y` downloads and executes the selected package without an interactive confirmation. 5. The package executes with the operating-system privileges and environment of the MCP process. ### Impact Assessment Successful exploitation permits arbitrary code execution under the account running OpenClaw or the MCP server. This can expose environment variables—including `YUNDIAN_WOO_IMPORTER_API_KEY`—and any files, network resources, or local processes accessible to that account. The code could also alter local files or interfere with MCP communications. This does not inherently provide administrator privileges, but its scope equals the privileges granted to the Agent process.
- Remediation
- ## Remediation Suggestions 1. Add `tsx` to `package.json` using an exact, reviewed version rather than a range. 2. Generate and commit a `package-lock.json` containing integrity hashes. 3. Install dependencies with `npm ci` from the committed lockfile. 4. Invoke the project-local executable, such as `node_modules/.bin/tsx`, instead of allowing `npx` to download packages automatically. 5. Remove the `-y` automatic-download workflow from the documented MCP configuration. 6. Use a trusted registry and consider restricting installation scripts where operationally feasible.
