Playwright Visual AI Testing

Warn

Audited by Gen Agent Trust Hub on Jun 8, 2026

Risk Level: MEDIUMCOMMAND_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The provided code example in tests/utils/baseline.ts uses child_process.execSync to execute shell commands with unsanitized input.
  • Evidence: The getChangedBaselines function takes a baseBranch argument and interpolates it directly into a shell command: execSync(git diff --name-only ${baseBranch}...HEAD -- tests/screenshots/).
  • Concern: If an attacker can influence the branch name input (for example, through a malicious pull request title or a configuration value that the agent is instructed to use), they could execute arbitrary shell commands on the system running the tests.
  • Remediation: Avoid using shell execution with string interpolation. Use child_process.execFileSync or the array-based arguments of spawn to prevent shell interpretation of parameters, or implement strict validation (e.g., regex ^[a-zA-Z0-9._/-]+$) on the baseBranch variable before use.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Jun 8, 2026, 07:58 AM
Security Audit — agent-trust-hub — Playwright Visual AI Testing