T08 · Insecure Dependencies
Warning
- Location
- package.json:7
- Finding
- Unpinned Remote Package Execution in Publishing Script## Vulnerability Details **File Location**: `package.json`, line 7 **Vulnerability Type**: Supply-chain risk caused by executing a remotely resolved package without version pinning **Risk Level**: Medium **Vulnerable Code**: ```json "publish:clawhub": "bunx clawhub@latest publish . --slug moltgram-social --name \"Moltgram\" --version 1.1.0 --tags latest" ``` ### Technical Analysis The publishing script invokes `bunx clawhub@latest`, which resolves and executes the latest available version of the `clawhub` package at runtime. Consequently, the code executed by this command can change without any corresponding modification to or review of this repository. This behavior is not required for the Skill's ordinary Moltgram functionality. It only affects maintainers or release operators who invoke the publishing script. Because the package version and integrity are not pinned, trust is delegated to the package registry, the package publisher account, and the package's transitive dependency chain at the time the command runs. ### Attack Path 1. An attacker compromises the `clawhub` package publisher account, package registry distribution channel, or a dependency included in a newly published version. 2. The attacker publishes a malicious release that becomes the version selected by the `@latest` tag. 3. A maintainer runs the `publish:clawhub` script in the project environment. 4. `bunx` retrieves and executes the attacker-controlled package before or during publication. 5. The malicious package executes with the maintainer's operating-system privileges and can access resources available to that process. ### Impact Assessment Successful exploitation could allow arbitrary code execution with the privileges of the maintainer invoking the script. Depending on the execution environment, exposed resources may include repository contents, environment variables, package or ClawHub publishing credentials, local files accessible to the u ...[truncated 294 chars]
- Remediation
- ## Remediation Suggestions - Replace `clawhub@latest` with an exact, reviewed version. - Prefer adding the CLI as a pinned development dependency and invoking the lockfile-resolved binary through a package script. - Commit and enforce the package-manager lockfile, including integrity metadata. - Require dependency review and controlled updates before changing the pinned CLI version. - Run publishing commands in an isolated, least-privileged environment with only the credentials required for publication. - Use short-lived publishing credentials and avoid exposing unrelated secrets to the publishing process. - Where supported, verify package provenance, signatures, and registry integrity before execution. Example hardened approach: ```json { "devDependencies": { "clawhub": "REVIEWED_EXACT_VERSION" }, "scripts": { "publish:clawhub": "clawhub publish . --slug moltgram-social --name \"Moltgram\" --version 1.1.0 --tags latest" } } ```
