T08 · Insecure Dependencies
- Location
SKILL.md:205- Finding
Unpinned npm Package Downloaded and Executed During Validation
- Content
View full analysis
/dev/null 2>&1 ``` ``` ### Technical Analysis The validation procedure invokes `npx -y acorn` without specifying an exact package version, integrity hash, or trusted local installation. If `acorn` is not already available locally, `npx` can retrieve the current package from the configured npm registry and execute it automatically. The `-y` option suppresses the confirmation prompt, so external package code may be downloaded and executed without explicit user approval. The executed package version can change after the Skill has been audited, making the validation process dependent on mutable third-party registry content. This is an insecure supply-chain practice. Compromise of the npm package, registry account, registry configuration, DNS path, or a transitive dependency could turn a syntax-validation step into arbitrary code execution. ### Attack Path 1. The Skill modifies or attempts to validate a TypeScript or JavaScript file. 2. The validation step runs `npx -y acorn`. 3. If a trusted local copy is unavailable, `npx` queries the configured npm registry. 4. A compromised or unexpectedly changed package version is downloaded. 5. npm package lifecycle behavior or package code executes with the same operating-system privileges as the Agent. 6. The malicious package can access files, environment variables, network resources, and credentials available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the Agent process's privileges. The accessible scope could include: - The current repository and other files writable by the Agent account. - Environment variables and locally available credentials. - Git configuration, tokens, and package-manager ...[truncated 383 chars]- Remediation
View remediation
/dev/null 2>&1 ``` 3. Prefer the package manager's immutable or frozen-lockfile mode when installing dependencies. 4. Pin an exact version and verify package integrity if runtime retrieval cannot be eliminated. 5. Run validation in a restricted environment without sensitive credentials and with network access disabled. 6. Document the required validator version and fail safely when it is unavailable rather than downloading it automatically. ]]>
