T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:17
- Finding
- Execution of an Unpinned npm Package and Unvalidated Shell Configuration## Vulnerability Details **File Location**: `SKILL.md`, lines 17-18 **Vulnerability Type**: Unpinned third-party dependency execution and unsafe shell configuration loading **Risk Level**: Medium ### Vulnerable Code ```bash # Check if authenticated echo $ATXP_CONNECTION # If not set, login: npx atxp login source ~/.atxp/config ``` ### Technical Analysis The authentication instructions execute `atxp` through `npx` without specifying a reviewed package version or enforcing an integrity constraint. Depending on the local npm environment, `npx atxp login` can download and execute the version currently resolved from the configured npm registry. The effective executable can therefore change after this Skill has been reviewed. The following instruction sources `~/.atxp/config` directly into the active shell. Shell `source` does not treat the file as passive configuration data: it executes every shell expression in the file with the user's privileges. Because the file is created or modified as part of the preceding package-driven login process, a compromised or unexpectedly changed package could place arbitrary commands in it. No evidence establishes that the current `atxp` package or generated configuration is malicious. The vulnerability is the absence of package version and integrity controls combined with execution of an unvalidated generated shell file. ### Attack Path 1. An attacker compromises the npm package, its publisher account, the package distribution process, or the registry resolution path. 2. The attacker publishes or causes resolution of a malicious `atxp` release. 3. A user follows the Skill instructions and runs `npx atxp login`. 4. `npx` retrieves and executes the attacker-controlled package under the user's account. 5. The malicious package can execute commands immediately or write shell commands into `~/.atxp/config`. 6. The user runs `source ~/.atxp/config`, causing any injected shell commands t ...[truncated 676 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `atxp` to a specifically reviewed version instead of resolving the latest available release: ```bash npx --yes atxp@<reviewed-version> login ``` 2. Install dependencies through a lockfile that records exact versions and integrity hashes. Use a reproducible installation mechanism such as `npm ci` where applicable. 3. Verify package provenance, publisher identity, signatures or attestations, and integrity metadata before execution. 4. Do not source a package-generated file as unrestricted shell code. Store the connection value in a data-only format and parse only the expected field. 5. Validate that the configuration file is owned by the current user, has restrictive permissions, is not a symbolic link, and contains only the expected variable before loading it. 6. If shell export syntax is unavoidable, display and review the generated file before use and reject command substitutions, redirections, additional commands, shell functions, and unexpected variable names. 7. Run authentication tooling with least privilege and never invoke these instructions through `sudo` or a privileged service account.
