T08 · Insecure Dependencies
- Location
SKILL.md:13- Finding
Unpinned npm Package Is Downloaded and Executed Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 13–17
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable code:
markdown ## Installation xapi is available via npx (no install needed): ```bash npx xapi-to <command>text ### Technical Analysis The skill directs the agent to execute `xapi-to` through `npx` without specifying an exact package version, integrity hash, or trusted lockfile. This pattern is repeated throughout the document for all supported operations. When the package is not already available locally, `npx` can retrieve the current package release from the configured npm registry and immediately execute its code. Consequently, the effective executable can change after the skill has been audited. Compromise of the package, its maintainer account, the package publication process, or the configured registry could turn an otherwise legitimate command into arbitrary local code execution. This is a supply-chain weakness rather than evidence that the currently published package is malicious. ### Attack Path 1. An attacker compromises the `xapi-to` package, a publisher account, or the package distribution channel. 2. The attacker publishes a modified release under the same package name. 3. An agent follows `SKILL.md` and invokes an ordinary command such as `npx xapi-to search "twitter"`. 4. Because no audited version is pinned, `npx` resolves and downloads the attacker-controlled release. 5. Package lifecycle or CLI code executes with the permissions and environment of the agent process. 6. The malicious package can access files and environment variables available to that process, potentially including `XAPI_API_KEY` and the documented `~/.xapi/config.json` credential file. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the operating-system account running the agent. The accessible ...[truncated 551 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every invocation to an exact, reviewed package version:
bash npx --yes xapi-to@<audited-version> <command> - Do not use version ranges or mutable distribution tags such as
latest. - Prefer installation from a committed lockfile with integrity metadata rather than downloading executable code on every invocation.
- Verify npm provenance, publisher identity, package signatures where supported, and registry configuration before deployment.
- Re-audit the package before changing the pinned version.
- Run the CLI in a restricted environment with minimal filesystem access, network permissions, and environment variables.
- Provide the API credential only to commands that require it, rather than exposing it broadly to the agent process.
- Pin every invocation to an exact, reviewed package version:
