Back to skill

Security audit

Playwright 1.0.3

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Playwright browser-automation skill with disclosed npm installation and browser-network behavior, though users should prefer pinned or lockfile-controlled Playwright installs.

Install only if you are comfortable using Playwright and npm-based tooling. For sensitive repositories or CI, prefer a project-local Playwright dependency with a committed lockfile, run npm ci, and avoid exposing unnecessary secrets or privileged browser sessions to test runs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:8
Finding
Unpinned npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 8-33 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: {"clawdbot":{"emoji":"P","requires":{"bins":["node","npx"]},"os":["linux","darwin","win32"],"install":[{"id":"npm-playwright","kind":"npm","package":"playwright","bins":["playwright"],"label":"Install Playwright"},{"id":"npm-playwright-mcp","kind":"npm","package":"@playwright/mcp","bins":["playwright-mcp"],"label":"Install Playwright MCP (optional)"}]}} ``` ```bash npx @playwright/mcp --headless ``` ### Technical Analysis The installation metadata identifies `playwright` and `@playwright/mcp` without exact versions, while the quick-start command invokes `@playwright/mcp` through `npx` without a version constraint. If the package is not already available locally, `npx` can retrieve and execute the version resolved from the configured npm registry at runtime. This makes the effective executable payload mutable after the Skill has been audited. The Skill therefore relies on the continuing integrity of the npm registry, package publisher accounts, package dependencies, and local npm configuration. A compromised or unexpectedly modified release could execute arbitrary package lifecycle or runtime code under the account running the Skill. The documented network transmission to user-requested web origins is otherwise necessary for the declared browser-automation functionality and is explicitly disclosed. No hidden data-exfiltration mechanism was identified. ### Attack Path 1. An attacker compromises the publication account, release process, or transitive dependency of an unpinned npm package, or influences the registry configured in the execution environment. 2. The user or Agent follows the documented quick-start command: `npx @playwright/mcp --headless`. 3. npm resolves a package release at execution time rather than using a pr ...[truncated 987 chars]
Remediation
## Remediation Suggestions 1. Pin both direct packages to reviewed exact versions rather than relying on registry-latest resolution. 2. Replace the quick-start command with an exact version, for example: ```bash npx --yes @playwright/mcp@<reviewed-exact-version> --headless ``` 3. Prefer declaring dependencies in `package.json`, committing the generated lockfile, installing with `npm ci`, and invoking the project-local binary. This provides deterministic dependency resolution. 4. Validate lockfile integrity in CI and use npm integrity metadata. Perform dependency updates through a controlled review process. 5. Disable or restrict unnecessary lifecycle scripts where operationally feasible, and execute browser tooling in a sandboxed, non-privileged environment with narrowly scoped filesystem and secret access. 6. Configure an approved registry explicitly and apply package provenance, signature, or allowlist verification where supported. 7. Keep browser credentials and sensitive environment variables out of the package-installation context whenever possible.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (14)

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The skill instructs users to run `npx @playwright/mcp --headless` without pinning a version, which causes execution of whatever package version is current at invocation time. Because this is an MCP/browser-automation package that will run local code with the user's privileges and potentially access browser state, a compromised or malicious upstream release could lead to immediate arbitrary code execution and data exposure.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding
The command `npx playwright test` is unpinned and may fetch or execute the latest Playwright CLI when it is not already installed locally. That creates a supply-chain risk because users may run code from an unexpected upstream version, though the risk is somewhat lower than the MCP server case because this is standard test tooling and often resolves to a repo-installed dependency.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding
The command `npx playwright test --headed` is likewise unpinned and can execute a latest upstream CLI version if absent locally. In a security-sensitive environment, this exposes the user to supply-chain compromise via package substitution or malicious new releases.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding
The unpinned `npx playwright test --trace on` command carries the same package-resolution risk as the other `npx playwright` examples. If a malicious or compromised package version is served, it would run locally with access to repository contents, environment variables, and generated trace artifacts.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
The `npx playwright codegen https://example.com` example is unpinned and may download and execute a current CLI release. Although presented as a developer convenience, it still executes upstream code locally and can expose users to the same supply-chain attack surface.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Static analysis

No suspicious patterns detected.