T08 · Insecure Dependencies
- Location
SKILL.md:20- Finding
Execution and Global Linking of an Unreviewed External npm Project
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 20-23
Vulnerability Type: Execution of an external, unbundled dependency
Risk Level: Highbash If not installed: ```bash cd /Users/tuan/.openclaw/workspace/mxe && npm run build && npm linktext ### Technical Analysis The installation instructions change into a hard-coded project directory outside the audited skill and execute its npm `build` lifecycle script. The contents, dependencies, and package scripts of that external project are not included in the audited artifact and therefore cannot be verified. `npm run build` executes whatever command is assigned to the external project's `build` script with the current user's privileges. The subsequent `npm link` operation exposes the resulting package executable through npm's global command environment. Consequently, files placed at or substituted into the referenced path can supply attacker-controlled scripts and an attacker-controlled `mxe` executable. The audited `package.json` only contains skill metadata and does not provide the referenced implementation, scripts, dependencies, lockfile, or integrity information. ### Attack Path 1. An attacker gains the ability to create, replace, or modify files under `/Users/tuan/.openclaw/workspace/mxe`. 2. The attacker adds a malicious npm `build` script or modifies the package's CLI entry point. 3. A user follows the documented installation procedure. 4. `npm run build` executes the attacker-controlled lifecycle command with the user's privileges. 5. `npm link` exposes the malicious executable as the apparently legitimate `mxe` command. 6. Subsequent document-conversion requests invoke the substituted executable. ### Impact Assessment Successful exploitation permits arbitrary command execution with the privileges of the user performing the installation. The malicious build or linked CLI could read or modify user-accessible files, ...[truncated 339 chars]- Remediation
View remediation
Remediation Suggestions
- Include the converter implementation in the reviewed project rather than relying on a hard-coded external workspace.
- Replace the absolute user-specific path with a project-relative, validated path.
- Audit all npm lifecycle scripts and CLI entry points before execution.
- Pin dependency versions and commit a lockfile with integrity metadata.
- Avoid
npm linkand other global installation mechanisms where possible; install the CLI locally and invoke it through an explicitly resolved project path. - If external installation is unavoidable, verify the source revision, package provenance, and cryptographic integrity before running any lifecycle scripts.
- Run installation and conversion in a sandbox with restricted filesystem, credential, and network access.
