T08 · Insecure Dependencies
Warning
- Location
- scripts/reddit.ts:1
- Finding
- Unpinned runtime dependency may be downloaded and executed through npx## Vulnerability Details **File Location**: `SKILL.md:47-55`, `README.md:83`, `scripts/reddit.ts:1`, `package.json:1-7` **Vulnerability Type**: Supply-chain risk from an undeclared and unpinned executable dependency **Risk Level**: Medium ### Vulnerable Code `SKILL.md:47-55`: ```bash npx tsx reddit.ts search "<query>" [options] ``` `scripts/reddit.ts:1`: ```typescript #!/usr/bin/env npx tsx ``` `package.json:1-7`: ```json { "name": "reddit-research", "version": "1.0.0", "description": "Reddit research skill for OpenClaw — zero auth, zero dependencies", "private": true, "type": "module" } ``` ### Technical Analysis The documented and embedded execution mechanism invokes `tsx` through `npx`, but `tsx` is not declared in `package.json`, pinned to an exact version, or protected by a committed lockfile. When no suitable local executable is available, `npx` may resolve, download, and execute the package from the configured npm registry. As a result, the code that executes before or alongside the audited Skill can change after review. The effective runtime therefore includes mutable third-party code that is not represented in the project manifest. This also conflicts with the documentation’s “zero dependencies” and “No npm install needed” claims. This is primarily an insecure dependency issue rather than evidence that the currently reviewed Skill contains an intentionally malicious payload. ### Attack Path 1. A user or Agent follows the documented `npx tsx reddit.ts ...` command. 2. The environment does not have an appropriate local `tsx` executable. 3. `npx` resolves the undeclared package using the configured npm registry. 4. An attacker compromises the package, one of its dependencies, its publisher account, or the registry resolution path. 5. The attacker-controlled package code is downloaded and executed before the audited Reddit CLI performs its intended operation. 6. The malicious dependency operates with the same OS permissions and acces ...[truncated 754 chars]
- Remediation
- ## Remediation Suggestions 1. Prefer compiling the TypeScript sources into JavaScript during a controlled release process and invoke the resulting artifact directly with Node.js: ```bash node dist/reddit.js search "query" ``` 2. If `tsx` must remain part of normal execution: - Declare it explicitly in `package.json`. - Pin it to an exact reviewed version rather than a range. - Commit a lockfile containing dependency integrity hashes. - Install dependencies in a controlled setup step using a trusted registry. - Use `npm ci` rather than resolving dependencies dynamically during every invocation. 3. Avoid `npx` runtime retrieval in the shebang and documentation. Reference a locally installed, lockfile-controlled executable instead. 4. Update the “zero dependencies” and “No npm install needed” documentation so it accurately reflects the execution model. 5. In higher-risk Agent environments, run the Skill with restricted filesystem access, minimal environment variables, no unnecessary credentials, and outbound network access limited to the documented Reddit providers.
