T08 · Insecure Dependencies
Warning
- Location
- README.md:29
- Finding
- Unpinned Third-Party Code Execution During Installation## Vulnerability Details **File Location**: `README.md`, line 29 **Vulnerability Type**: Unpinned executable dependency and mutable remote source **Risk Level**: Medium ### Vulnerable Code ```bash npx add https://github.com/wpank/ai/tree/main/skills/api/auth-patterns ``` ### Technical Analysis The installation command uses `npx` to resolve and execute the package that provides the `add` command. When that package is not already available locally, `npx` may retrieve executable code from the npm ecosystem and run it with the current user's privileges. The command does not specify an exact package version or integrity hash. It also references content through a mutable GitHub branch path rather than an immutable, reviewed commit. Therefore, the code executed or installed by this command can change after the Skill has been audited without any corresponding modification to this repository. This creates a supply-chain trust gap. Although the audited files contain no confirmed malicious payload, compromise or replacement of the resolved npm package or upstream repository could turn the documented installation procedure into an arbitrary code-execution channel. ### Attack Path 1. An attacker compromises the package resolved by `npx add`, its maintainer account, publishing credentials, or the referenced upstream repository. 2. The attacker publishes a modified installer or changes content reachable through the mutable repository path. 3. A user follows the installation command documented in `README.md`. 4. `npx` downloads and executes the altered package without validating it against an audited version or integrity hash. 5. The malicious installer executes with the privileges of the user running the command. 6. The payload may read or modify accessible source code, configuration files, Agent instructions, environment variables, credentials, or other user-owned data. ### Impact Assessment Successful exploitation provides co ...[truncated 476 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the `npx add` command with a non-executing installation process where practical, such as downloading or cloning reviewed files and copying them into the intended Skill directory. 2. Pin the upstream repository to an immutable commit hash instead of a mutable branch: ```bash git clone https://github.com/wpank/ai.git cd ai git checkout <reviewed-commit-hash> ``` 3. Publish and verify a cryptographic checksum or signed release before installing files. 4. If an npm-based installer is necessary, use the explicit trusted package name and an exact version rather than the ambiguous unpinned `npx add` invocation: ```bash npx --yes trusted-package@<exact-version> ... ``` 5. Pin dependency integrity metadata through an npm lockfile and verify package provenance or registry signatures where supported. 6. Document the expected package owner, registry, commit, checksum, and files installed so users can verify the source before execution. 7. Run installation with least privilege in an isolated environment, without unnecessary credentials or access to unrelated sensitive directories.
