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.tsuseschild_process.execSyncto execute shell commands with unsanitized input. - Evidence: The
getChangedBaselinesfunction takes abaseBranchargument 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.execFileSyncor the array-based arguments ofspawnto prevent shell interpretation of parameters, or implement strict validation (e.g., regex^[a-zA-Z0-9._/-]+$) on thebaseBranchvariable before use.
Audit Metadata