T08 · Insecure Dependencies
- Location
scripts/run.sh:126- Finding
Unpinned Playwright CLI Package Is Downloaded and Executed
- Content
View full analysis
"$OUTPUT_DIR/xhs_data.json" ``` ### Technical Analysis The script invokes `@playwright/cli` through `npx` without specifying an exact package version or requiring a previously installed, lockfile-verified dependency. Depending on the local npm configuration and cache state, `npx` can retrieve the current package release from the configured registry and execute it immediately. Consequently, the code that runs is not fully represented by the audited project. Its behavior may change after the skill has been reviewed. A compromised registry account, malicious package release, registry redirection, or untrusted npm configuration could cause arbitrary package code to execute with the privileges of the user running the skill. ### Attack Path 1. An attacker compromises the `@playwright/cli` distribution channel, publishes a malicious release, or controls the npm registry configured on the host. 2. A user invokes `scripts/run.sh`. 3. `npx` resolves the unpinned package from the configured registry or cache. 4. The package's installation or runtime code executes locally. 5. The malicious package can access files, environment variables, browser state, and network resources available to the invoking user. ### Impact Assessment Successful exploitation permits arbitrary code execution with the operating-system privileges of the user or agent running the skill. The reachable scope can include: - Reading or modifying files accessible to the invoking account. - Accessing environment variables and locally available tokens. - Interacting with browser data and authenticated Xiaohongshu sessions. - Sending data over the network. - Modifying generated reports or scraper results. The code does not itself request elevated ...[truncated 89 chars]- Remediation
View remediation
