T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:70
- Finding
- Unpinned Playwright Package Execution Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:70-73` **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```markdown ### Render board snapshot 1. Generate an HTML file using chessboard.js with the FEN from game state 2. Screenshot with Playwright: `npx playwright screenshot --browser chromium --viewport-size=440,520 board.html output.png` 3. Send the image to user ``` ### Technical Analysis The documented workflow instructs the agent to execute Playwright through `npx` without specifying a package version, lockfile, integrity hash, or verified local installation. When the package is not already available locally, `npx` can retrieve and execute the currently resolved package from the configured package registry. Consequently, the code executed by this workflow can differ from the code that existed when the skill was reviewed. This creates a supply-chain risk because the effective executable dependency is mutable and outside the audited project. There is no evidence in the reviewed project that the current Playwright package is malicious. The vulnerability is the unsafe, unpinned package-resolution and execution mechanism. ### Attack Path 1. A user asks the agent to render a chessboard snapshot. 2. The agent follows the workflow in `SKILL.md`. 3. The environment does not contain a verified local Playwright installation. 4. `npx` resolves and potentially downloads the package from its configured registry. 5. If the resolved package, a transitive dependency, registry response, or package-resolution configuration has been compromised, attacker-controlled package code executes. 6. The malicious code runs with the operating-system permissions and data access of the account invoking the skill. ### Impact Assessment Successful exploitation could permit arbitrary local code execution within the privileges of the agent process. Depending on the execution environment, this could expose files ...[truncated 368 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Declare Playwright as a project dependency at an explicitly approved version. 2. Commit and enforce a package lockfile containing dependency versions and integrity metadata. 3. Install dependencies during a controlled setup or build phase rather than during normal skill execution. 4. Invoke the verified local binary, for example: ```bash ./node_modules/.bin/playwright screenshot \ --browser chromium \ --viewport-size=440,520 \ board.html output.png ``` 5. Use deterministic installation such as `npm ci` and configure normal skill execution to reject implicit package downloads. 6. Apply registry allowlisting, dependency scanning, and lockfile integrity verification in the deployment pipeline. 7. Where practical, run screenshot generation in a sandbox with restricted filesystem, credential, and network access. ]]>
