T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:179
- Finding
- Unpinned Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md:179` **Vulnerability Type**: Unsafe third-party package resolution and execution **Risk Level**: Medium **Vulnerable Code Snippet**: ```bash npx tsc --noEmit ``` ### Technical Analysis The skill instructs an agent to invoke `tsc` through `npx` without requiring a locally installed, lockfile-pinned TypeScript dependency. If the expected executable is unavailable locally, `npx` may resolve and download a package from the configured package registry before executing it. The instruction does not enforce local-only execution, validate the resolved package, specify an approved registry, or pin an expected package version. This creates a supply-chain trust boundary in a routine pre-commit operation. In particular, the executable name `tsc` does not itself establish that the binary came from the official `typescript` package. ### Attack Path 1. An agent follows the skill's pre-commit checklist. 2. The target repository does not have the expected local `tsc` executable installed. 3. `npx` attempts to resolve the executable using the environment's configured package registry. 4. An unexpected, substituted, or compromised package is downloaded. 5. Package installation hooks or the resolved executable run with the operating-system privileges of the agent. 6. Malicious package code can access data and resources available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the same privileges as the agent process. Depending on the execution environment, this may expose repository contents, environment variables, developer credentials, package-manager tokens, SSH material, and writable files accessible to the current account. It does not directly grant privileges beyond those already held by the agent, but it could compromise the full scope of that account's accessible workspace and credentials.
- Remediation
- ## Remediation Suggestions - Declare `typescript` as an approved development dependency with an exact or lockfile-controlled version. - Require installation from a trusted registry using a committed lockfile and a reproducible command such as `npm ci`. - Prevent `npx` from downloading missing packages: ```bash npx --no-install tsc --noEmit ``` - Prefer a package script that resolves the lockfile-installed binary: ```json { "scripts": { "typecheck": "tsc --noEmit" } } ``` Then run: ```bash npm run typecheck ``` - Fail safely when the dependency is absent rather than allowing automatic registry resolution. - In sensitive environments, verify registry configuration, dependency integrity, and lockfile changes before execution.
