{
  "audit_id": "aud_20261126_0b5edf6",
  "commit_sha": "2337aff0213d28db41d3e3daf48cee19b3d0bd82",
  "scanner_digests": {
    "trivy": "sha256:8f6bb947dbc528902e11f2f5be52f7b519f6a39d5d148f41166f2040499768fb",
    "osv_scanner": "sha256:a70ffffc2bfd33482953e5d6b64c6fcdb30239717a07b0f0d3ab2859ce3e4cde",
    "semgrep": "sha256:67518c174185a2043fdbed16c70631b79209499b3671178e7194379b48295a0d",
    "trufflehog": "sha256:8fd07ea46a3f59583c4d50f006d8cf150530141b28969c3c34cc455cb9165a6b"
  },
  "scanner_execution": {
    "cve": true,
    "sast": true,
    "secrets": true,
    "install_hooks": true,
    "prompt_injections": true,
    "supply_chain": true
  },
  "metrics": {
    "loc_total": 1490,
    "direct_dependencies": 2,
    "transitive_dependencies": 94,
    "has_lockfile": true,
    "lockfile_names": [
      "package-lock.json"
    ],
    "unpinned_dependencies_count": 0,
    "floating_url_or_git_deps_count": 0,
    "pinning_posture": "STRICT_LOCKED",
    "has_test_files": true,
    "test_file_count": 10,
    "license_osi_approved": true
  },
  "findings": {
    "cve_critical": [],
    "cve_high": [],
    "secrets_verified": [],
    "secrets_production": [],
    "secrets_test_fixtures": [],
    "suspicious_install_hooks": [],
    "sast_blocking": [
      {
        "id": "ST-SAST-001",
        "check_id": "rules.zerolabs-js-command-injection",
        "path": "/src/roll.js",
        "line": 34,
        "message": "Potential command injection via child_process.exec or execSync.",
        "severity": "HIGH"
      },
      {
        "id": "ST-SAST-002",
        "check_id": "rules.zerolabs-js-command-injection",
        "path": "/src/roll.js",
        "line": 62,
        "message": "Potential command injection via child_process.exec or execSync.",
        "severity": "HIGH"
      },
      {
        "id": "ST-SAST-003",
        "check_id": "rules.zerolabs-js-command-injection",
        "path": "/src/roll.js",
        "line": 73,
        "message": "Potential command injection via child_process.exec or execSync.",
        "severity": "HIGH"
      },
      {
        "id": "ST-SAST-004",
        "check_id": "rules.zerolabs-js-command-injection",
        "path": "/src/update-readme.js",
        "line": 179,
        "message": "Potential command injection via child_process.exec or execSync.",
        "severity": "HIGH"
      }
    ],
    "iac_misconfigs": [],
    "prompt_injections": [],
    "supply_chain_anomalies": []
  },
  "sanitized_excerpts": [
    {
      "excerpt_id": "EX-001",
      "file": "cli.js",
      "lines": "1-32",
      "content": "#!/usr/bin/env node\n/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst { program } = require('playwright-core/lib/utilsBundle');\nconst { tools, libCli } = require('playwright-core/lib/coreBundle');\n\nif (process.argv.includes('install-browser')) {\n  const argv = process.argv.map(arg => arg === 'install-browser' ? 'install' : arg);\n  libCli.decorateProgram(program);\n  void program.parseAsync(argv);\n  return;\n}\n\nconst packageJSON = require('./package.json');\nconst p = program.version('Version ' + packageJSON.version).name('Playwright MCP');\ntools.decorateMCPCommand(p, packageJSON.version);\n\nvoid program.parseAsync(process.argv);"
    },
    {
      "excerpt_id": "EX-002",
      "file": "tests/cli.spec.ts",
      "lines": "1-48",
      "content": "/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport child_process from 'child_process';\nimport fs from 'fs';\nimport path from 'path';\nimport { test, expect } from './fixtures';\n\nconst cliPath = path.resolve(__dirname, '..', 'cli.js');\n\ntest('install-browser --help', async () => {\n  const output = child_process.execSync(`node ${cliPath} install-browser --help`, { encoding: 'utf-8' });\n  expect(output).toContain('install');\n});\n\ntest('documented env vars in README are supported by runtime', async () => {\n  const readmePath = path.resolve(__dirname, '..', 'README.md');\n  const readme = fs.readFileSync(readmePath, 'utf-8');\n  const optionsSectionMatch = readme.match(/<!--- Options generated by update-readme\\.js -->([\\s\\S]*?)<!--- End of options generated section -->/);\n  expect(optionsSectionMatch).toBeTruthy();\n\n  const optionsSection = optionsSectionMatch![1];\n  const documentedEnvVars = [...optionsSection.matchAll(/\\*env\\* `(PLAYWRIGHT_MCP_[A-Z0-9_]+)(?:=[^`]+)?`/g)].map(m => m[1]);\n  expect(documentedEnvVars.length).toBeGreaterThan(0);\n\n  const coreBundle = fs.readFileSync(require.resolve('playwright-core/lib/coreBundle'), 'utf-8');\n  const runtimeEnvVars = new Set(coreBundle.match(/\\bPLAYWRIGHT_MCP_[A-Z0-9_]+\\b/g) || []);\n  const unsupported = documentedEnvVars.filter(envVar => !runtimeEnvVars.has(envVar));\n  expect(unsupported).toEqual([]);\n\n  expect(optionsSection).toMatch(/\\| --no-sandbox \\|[^|\\r\\n]*\\*env\\* `PLAYWRIGHT_MCP_SANDBOX=false` \\|/);\n\n  const { tools } = require('playwright-core/lib/coreBundle');\n  const config = await tools.resolveCLIConfigForMCP({}, { PLAYWRIGHT_MCP_SANDBOX: 'false' });\n  expect(config.browser.launchOptions.chromiumSandbox).toBe(false);\n});"
    },
    {
      "excerpt_id": "EX-003",
      "file": "tests/click.spec.ts",
      "lines": "1-49",
      "content": "/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { test, expect } from './fixtures';\n\ntest('browser_click', async ({ client, server }) => {\n  server.setContent('/', `\n    <title>Title</title>\n    <button>Submit</button>\n    <script>\n      const button = document.querySelector('button');\n      button.addEventListener('click', () => {\n        button.focus(); // without manual focus, webkit focuses body\n      });\n    </script>\n  `, 'text/html');\n\n  expect(await client.callTool({\n    name: 'browser_navigate',\n    arguments: { url: server.PREFIX },\n  })).toHaveResponse({\n    code: `await page.goto('${server.PREFIX}');`,\n    snapshot: expect.stringContaining(`- button \\\"Submit\\\" [ref=e2]`),\n  });\n\n  expect(await client.callTool({\n    name: 'browser_click',\n    arguments: {\n      element: 'Submit button',\n      target: 'e2',\n    },\n  })).toHaveResponse({\n    code: `await page.getByRole('button', { name: 'Submit' }).click();`,\n    snapshot: expect.stringContaining(`button \"Submit\" [active] [ref=e2]`),\n  });\n});"
    },
    {
      "excerpt_id": "ST-METRIC-LOC",
      "file": "METRICS",
      "lines": "LOC: 1490",
      "content": "Verified total codebase lines of code: 1490"
    },
    {
      "excerpt_id": "ST-METRIC-TESTS",
      "file": "METRICS",
      "lines": "TestFiles: 10",
      "content": "Verified automated test file count: 10 (has_test_files=True)"
    },
    {
      "excerpt_id": "ST-METRIC-DEPS",
      "file": "METRICS",
      "lines": "Dependencies: 2",
      "content": "Verified dependencies: direct=2, transitive=94"
    },
    {
      "excerpt_id": "ST-METRIC-LOCK",
      "file": "METRICS",
      "lines": "Pinning: STRICT_LOCKED",
      "content": "Lockfiles: ['package-lock.json'] | pinning_posture=STRICT_LOCKED | unpinned=0 | floating_git=0"
    }
  ]
}