T08 · Insecure Dependencies
Warning
- Location
- README.md:30
- Finding
- Unpinned npm installer executes content from a mutable GitHub branch<![CDATA[ ## Vulnerability Details **File Location**: `README.md`, line 30 **Vulnerability Type**: Unpinned third-party dependency and mutable source execution **Risk Level**: Medium ```bash npx add https://github.com/wpank/ai/tree/main/skills/devops/prometheus ``` ### Technical Analysis The installation instruction invokes `npx`, which may download and execute the npm package named `add` with the permissions of the current user. The package is not pinned to a reviewed exact version or integrity digest. It also installs content from a mutable GitHub branch rather than an immutable, verified commit. The command therefore depends on two mutable supply-chain components: 1. The npm package resolved for `add`. 2. The content currently present in the referenced GitHub branch. No evidence establishes that either current upstream component is malicious. The risk arises because their effective content may change after this audit without requiring a change to the audited repository. ### Attack Path 1. An attacker compromises the npm package, package maintainer account, registry publication process, GitHub repository, or repository maintainer account. 2. The attacker publishes malicious package logic or replaces content in the referenced mutable branch. 3. A user follows the installation command from `README.md`. 4. `npx` retrieves and executes the resolved npm package. 5. The installer processes attacker-controlled repository content and may execute additional code within the user's environment. 6. Malicious logic runs with the invoking user's permissions and can access resources available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the account running the command. Depending on that account's privileges and environment, an attacker could: - Read or modify user-accessible files. - Access user-readable credentials, tokens, or development configuration. - Alter installed AI Agent Skill instructions. ...[truncated 341 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin the npm package to a reviewed exact version rather than relying on implicit package resolution. - Pin repository content to a verified immutable commit instead of a mutable branch. - Prefer an installer that supports checksum or signature verification. - Publish expected hashes or signed release artifacts and require verification before installation. - Document the exact reviewed package version and source commit. - Advise users to perform initial installation in a restricted environment without sensitive credentials. - Avoid running installation commands as `root` or through `sudo`. - Periodically review the pinned dependency and commit before intentionally updating them. A hardened command should conceptually use an exact npm version and an immutable repository commit: ```bash npx --yes add@<reviewed-exact-version> \ https://github.com/wpank/ai/tree/<verified-commit>/skills/devops/prometheus ``` The placeholders must be replaced with versions and commits that have actually been reviewed and verified. ]]>
