T08 · Insecure Dependencies
- Location
SKILL.md:29- Finding
Unpinned Third-Party Dependencies and Direct Execution of Remotely Resolved Packages
- Content
View full analysis
# or: npx @open-slide/cli init cd pnpm install # or npm install ``` From `requirements.txt:1-2`: ```text playwright>=1.40 Pillow>=10.0 ``` ### Technical Analysis The documented workflow downloads and executes third-party packages without fixing them to versions that were reviewed: - `pnpm dlx @open-slide/cli` and `npx @open-slide/cli` resolve and directly execute a currently available version of the package. - The Python dependencies use open-ended lower bounds. Any future release satisfying `>=1.40` or `>=10.0` may be installed. - No dependency hashes or lockfiles are specified to verify the integrity and identity of resolved artifacts. - `python3 -m playwright install chromium` downloads a browser binary associated with the dynamically resolved Playwright version. - Subsequent `pnpm install` or `npm install` in the generated project may execute package lifecycle scripts from the resolved dependency graph. Consequently, the effective code executed by the workflow can change after the Skill has been audited. A compromised package maintainer account, malicious eligible release, registry compromise, dependency confusion condition, or unexpected upstream release could introduce attacker-controlled code. No evidence shows that the currently included project files are themselves malicious. The risk arises from unsafe dependency resolution and direct execution practices. ### Attack Path 1. An attacker compromises the `@open-slide/cli`, Playwr ...[truncated 1545 chars]- Remediation
View remediation
init ``` or: ```bash npx --yes @open-slide/cli@ init ``` 2. **Pin Python dependencies to exact versions:** ```text playwright== Pillow== ``` 3. **Require cryptographic hash verification for Python packages:** ```bash python3 -m pip install --require-hashes -r requirements.txt ``` Populate `requirements.txt` with hashes generated from trusted, reviewed artifacts. 4. **Commit and enforce package-manager lockfiles** for generated or maintained Node.js projects. Use immutable installation modes where supported, such as: ```bash pnpm install --frozen-lockfile ``` or: ```bash npm ci ``` 5. **Audit transitive dependencies and lifecycle scripts** before updates. Dependency updates should be deliberate review events rather than automatically accepting every future compatible release. 6. **Use trusted registries explicitly** and configure namespace protections to reduce dependency confusion and registry substitution risks. 7. **Verify downloaded browser binaries** through Playwright's supported integrity mechanisms, and ensure the Playwright package version is pinned before running the Chromium installer. 8. **Run installation and export operations with least privilege**, preferably in an isolated container or restricted development account without production credentials. ]]>
