T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:159
- Finding
- Unpinned Packages Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:159-209` **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash # Render and publish workflow npx hyperframes publish # Format HTML npx oxfmt registry/{kind}/{name}/*.html # Generate catalog documentation npx tsx scripts/generate-catalog-pages.ts # Publish the generated project npx hyperframes publish ``` The quality gate repeats the same unpinned package execution requirements: ```markdown - [ ] `npx oxfmt --check` passes - [ ] `npx hyperframes publish` run (claim your project URL) ``` ### Technical Analysis The workflow instructs contributors to invoke `hyperframes`, `oxfmt`, and `tsx` through `npx` without specifying exact package versions or requiring resolution from an integrity-protected repository lockfile. If a requested package is not already installed in the local project, `npx` can retrieve it from the configured package registry and immediately execute its code. Package installation scripts, transitive dependencies, and the package's command-line entry point consequently execute with the privileges and environment of the contributor. The effective code executed by these commands is therefore not fully represented in the reviewed Skill. It may change because of a compromised package release, compromised maintainer account, registry attack, malicious transitive dependency, or unexpected package resolution. ### Attack Path 1. An attacker compromises one of the referenced packages, a transitive dependency, a maintainer account, or the configured package registry. 2. The attacker publishes or serves a malicious package version. 3. A contributor follows the Skill and runs an unversioned `npx` command. 4. If no trusted local version is available, `npx` downloads and executes the externally resolved package. 5. Malicious installation or runtime code executes with the contributor's user privileges. 6. The payload can inspect ...[truncated 918 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Declare all required command-line packages in the target repository's `devDependencies`. 2. Pin exact versions rather than using floating ranges where practical. 3. Commit an integrity-protected lockfile and install dependencies with a frozen-lockfile command such as: ```bash npm ci ``` 4. Invoke repository-local binaries without permitting automatic downloads: ```bash npm exec --offline -- hyperframes publish npm exec --offline -- oxfmt registry/{kind}/{name}/*.html npm exec --offline -- tsx scripts/generate-catalog-pages.ts ``` 5. Configure npm to disable lifecycle scripts where they are unnecessary: ```bash npm ci --ignore-scripts ``` 6. Review and audit direct and transitive dependencies before updating the lockfile. 7. Run publishing and generation tools in a restricted container or CI environment with minimum filesystem access and short-lived credentials. 8. Require explicit user confirmation before commands that publish content or use authenticated GitHub and registry sessions. ]]>
