T08 · Insecure Dependencies
Error
- Location
- SKILL.md:91
- Finding
- Unpinned npx Commands May Download and Execute Untrusted Packages<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:91-97` **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: High ### Vulnerable Code ```bash # TypeScript (if tsconfig.json exists) [ -f tsconfig.json ] && npx tsc --noEmit 2>&1 # Python (if .py files exist) [ -f pyproject.toml ] && python -m ruff check . 2>&1 # ESLint (if .eslintrc* exists) ls .eslintrc* eslint.config.* 2>/dev/null && npx eslint . 2>&1 ``` ### Technical Analysis The skill invokes `npx tsc` and `npx eslint` without requiring locally installed, lockfile-pinned executables and without using a no-download option. When the requested executable is not available locally, `npx` may resolve and download a package from the configured package registry before executing it. The presence of `tsconfig.json`, `.eslintrc*`, or `eslint.config.*` is insufficient to establish that the expected package is safely installed. In particular, the executable name `tsc` does not itself guarantee that it resolves to the expected TypeScript compiler package. Because package resolution can depend on the local environment, registry configuration, and available dependencies, reviewed skill behavior can change at runtime. A compromised registry package, dependency-confusion condition, malicious registry configuration, or unintended package resolution could therefore introduce arbitrary code execution. ### Attack Path 1. An attacker prepares or influences a repository containing `tsconfig.json` or an ESLint configuration file. 2. The repository does not contain a trusted local installation of the corresponding executable, or its dependency state causes `npx` to perform remote resolution. 3. The user invokes the Deploy Guardian skill against that repository. 4. Gate 3 runs `npx tsc` or `npx eslint`. 5. `npx` resolves and potentially downloads a package from the configured registry. 6. The resolved package executes with the same operating-system permissions, network access, environment variab ...[truncated 629 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require the relevant tools to be installed as lockfile-pinned project dependencies. 2. Prevent `npx` from downloading missing packages: ```bash npx --no-install tsc --noEmit 2>&1 npx --no-install eslint . 2>&1 ``` 3. Prefer explicit local executable paths where supported: ```bash ./node_modules/.bin/tsc --noEmit ./node_modules/.bin/eslint . ``` 4. Verify that a supported lockfile exists and install dependencies using reproducible, lockfile-enforcing commands such as `npm ci`. 5. Skip or fail the applicable check if the trusted local executable is unavailable rather than resolving it dynamically. 6. Execute all repository-controlled tools inside a restricted sandbox with minimal credentials, limited filesystem access, and controlled network egress. ]]>
