T08 · Insecure Dependencies
- Location
scripts/reddit.ts:1- Finding
Unpinned runtime dependency may be downloaded and executed through npx
- Content
View full analysis
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: MediumVulnerable Code
SKILL.md:47-55:bash npx tsx reddit.ts search "<query>" [options]scripts/reddit.ts:1:typescript #!/usr/bin/env npx tsxpackage.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
tsxthroughnpx, buttsxis not declared inpackage.json, pinned to an exact version, or protected by a committed lockfile. When no suitable local executable is available,npxmay 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
- A user or Agent follows the documented
npx tsx reddit.ts ...command. - The environment does not have an appropriate local
tsxexecutable. npxresolves the undeclared package using the configured npm registry.- An attacker compromises the package, one of its dependencies, its publisher account, or the registry resolution path.
- The attacker-controlled package code is downloaded and executed before the audited Reddit CLI performs its intended operation.
- The malicious dependency operates with the same OS permissions and acces ...[truncated 754 chars]
- A user or Agent follows the documented
- Remediation
View remediation
Remediation Suggestions
-
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" -
If
tsxmust 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 cirather than resolving dependencies dynamically during every invocation.
- Declare it explicitly in
-
Avoid
npxruntime retrieval in the shebang and documentation. Reference a locally installed, lockfile-controlled executable instead. -
Update the “zero dependencies” and “No npm install needed” documentation so it accurately reflects the execution model.
-
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.
-
