T08 · Insecure Dependencies
- Location
SKILL.md:21- Finding
Unpinned npm Package Execution Creates a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 21
Vulnerability Type: Unpinned third-party package installation and execution
Risk Level: MediumVulnerable Code
markdown Run commands with `npx posthive-cli` or `posthive` if installed globally (`npm i -g posthive-cli`).Technical Analysis
The skill instructs the agent to run
posthive-clithroughnpxor install it globally without specifying a reviewed version. With no version pin, lockfile, integrity hash, signature check, or publisher verification, npm can resolve a mutable package release at execution time.The
npx posthive-cliform may download and immediately execute the resolved package. The global installation alternative can also execute npm installation lifecycle scripts and place package-controlled executables in the user's global command path. Consequently, later compromise of the package, its publisher account, or a transitive dependency could turn an otherwise legitimate skill invocation into arbitrary local code execution.No evidence establishes that the current package is malicious. The vulnerability is the unsafe dependency acquisition and execution model.
Attack Path
- An attacker compromises the
posthive-clipackage, its publisher account, or a transitive dependency and publishes a malicious release. - The agent follows the skill instructions and invokes
npx posthive-clior runsnpm i -g posthive-cli. - npm resolves the unpinned malicious release.
- Package code or an installation lifecycle script executes with the invoking user's permissions.
- The payload accesses resources available to that user or modifies the globally installed command.
- It may target the documented Posthive configuration at
~/.posthive/config.json, readPOSTHIVE_API_KEYfrom the process environment, or use authenticated social-media operations to perform unauthorized actions.
Impact Assessment
Successful exploitation provides code execution with ...[truncated 466 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Pin
posthive-clito a specific reviewed version rather than resolving the latest release implicitly. - Install the dependency locally using a committed lockfile with npm integrity metadata.
- Prefer invoking the audited local executable instead of using ad hoc
npxdownloads or global installation. - Verify and document the package's official npm scope, publisher, repository, and expected release provenance.
- Validate package integrity through registry integrity hashes or signed provenance before execution.
- Disable npm lifecycle scripts during installation where compatible, then explicitly execute only reviewed setup operations.
- Run the CLI with least privilege and expose only the credentials required for the requested operation.
- Protect
~/.posthive/config.jsonwith restrictive filesystem permissions and avoid unnecessarily propagatingPOSTHIVE_API_KEYto child processes.
- Pin
