# browser-agent-automation-v1

> browser-agent-automation-v1: 22 Keryn rules for javascript, typescript, python, json (6 error, 16 warning).

Source: https://keryn.dev/rules/browser-agent-automation-v1/

22 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**How to read a rule**

- **Severity**: How bad the finding is if it is real: `error` fails a default gate, `warning` and `info` do not.

- **Confidence**: **P0** exploitable as written; **P1** dangerous in context; **P2** a heuristic or a posture check: confirm by reading the code.

- **False-positive risk**: **low**: an exact API or flag, so hits are almost always real; **medium**: the pattern is legitimate in many programs, so check each hit; **high**: it finds a lead to confirm, so expect benign hits.

- **Edge**: The relationship the finding sits on. **reaches**: content or traffic gets to a thing; **calls**: one thing invokes another; **reads**: one thing reads from another; **writes**: one thing writes to another; **sends**: data leaves for another party; **grants**: authority is given or left unchecked; **depends_on**: something relies on a component it does not verify; **trusts**: one party believes another without evidence. The boundary it crosses, when there is one: **user->prompt** (untrusted input reaching a prompt); **model->code** (model output reaching code, a shell, a query or a page); **secret->outside** (a secret leaving the trusted side); **supply-chain** (code, models or prompts pulled in from outside).

- **Taxonomy chips**: References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

## keryn.browseragent.model-output-to-page-navigation-js

`error` javascript, typescript data-flow rule playwright, puppeteer, cdp

A URL produced by the model (completion text, tool-call arguments, a tool parameter) is passed straight to the browser's navigation. A prompt-injected or hallucinated URL then opens internal services, file:// paths or phishing pages inside the agent's browser session, with whatever cookies and exposed functions that session carries. Resolve the URL, check its scheme and host against an allowlist, and navigate only after the check.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-918](https://keryn.dev/taxonomies/cwe/#cwe-918-server-side-request-forgery) [CWE-441](https://keryn.dev/rules/?cwe=CWE-441) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack)

**Fix:** Parse the model's URL with new URL(), allow only http(s), compare the hostname with an explicit allowlist (or the task's origin) and reject private and link-local address ranges before calling goto; log the navigation.

**References:** [https://playwright.dev/docs/api/class-page#page-goto](https://playwright.dev/docs/api/class-page#page-goto) · [https://pptr.dev/api/puppeteer.page.goto](https://pptr.dev/api/puppeteer.page.goto) · [https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigate](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigate)

## keryn.browseragent.model-output-to-page-navigation-py

`error` python data-flow rule playwright

A URL produced by the model (completion text, tool-call arguments, a tool parameter) is passed straight to the browser's navigation. A prompt-injected or hallucinated URL then opens internal services, file:// paths or phishing pages inside the agent's browser session, with whatever cookies and exposed functions that session carries. Resolve the URL, check its scheme and host against an allowlist, and navigate only after the check.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-918](https://keryn.dev/taxonomies/cwe/#cwe-918-server-side-request-forgery) [CWE-441](https://keryn.dev/rules/?cwe=CWE-441) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack)

**Fix:** Parse the model's URL with urllib.parse, allow only http(s), compare the hostname with an explicit allowlist (or the task's origin) and reject private and link-local address ranges before calling goto; log the navigation.

**References:** [https://playwright.dev/python/docs/api/class-page#page-goto](https://playwright.dev/python/docs/api/class-page#page-goto)

## keryn.browseragent.model-output-to-page-script-js

`error` javascript, typescript data-flow rule playwright, puppeteer, cdp

JavaScript or a script URL produced by the model is executed in the automation page (evaluate, addScriptTag, addInitScript, Runtime.evaluate). The model, and anything that injected into its context, then runs arbitrary code in the page with access to the page's origin, storage and every function the host exposed. Keep page scripts as fixed functions in your code and pass model output only as a serialisable argument.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-94](https://keryn.dev/taxonomies/cwe/#cwe-94-code-injection) [CWE-95](https://keryn.dev/rules/?cwe=CWE-95) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Call page.evaluate with a function literal defined in your source and pass model data as its argument (page.evaluate((v) =&gt; ..., value)); never build the script body or a script URL from model text.

**References:** [https://playwright.dev/docs/api/class-page#page-evaluate](https://playwright.dev/docs/api/class-page#page-evaluate) · [https://pptr.dev/api/puppeteer.page.evaluate](https://pptr.dev/api/puppeteer.page.evaluate) · [https://pptr.dev/api/puppeteer.page.addscripttag](https://pptr.dev/api/puppeteer.page.addscripttag) · [https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-evaluate](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-evaluate)

## keryn.browseragent.model-output-to-page-script-py

`error` python data-flow rule playwright

JavaScript produced by the model is executed in the automation page (evaluate, add\_script\_tag, add\_init\_script). The model, and anything that injected into its context, then runs arbitrary code in the page with access to the page's origin, storage and every function the host exposed. Keep page scripts as fixed strings in your code and pass model output only as the serialisable argument.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-94](https://keryn.dev/taxonomies/cwe/#cwe-94-code-injection) [CWE-95](https://keryn.dev/rules/?cwe=CWE-95) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Call page.evaluate with a fixed script and pass model data as its argument (page.evaluate("v =&gt; ...", value)); never build the script body or a script URL from model text.

**References:** [https://playwright.dev/python/docs/api/class-page#page-evaluate](https://playwright.dev/python/docs/api/class-page#page-evaluate) · [https://playwright.dev/python/docs/api/class-page#page-add-script-tag](https://playwright.dev/python/docs/api/class-page#page-add-script-tag)

## keryn.browseragent.model-output-to-page-html-js

`warning` javascript, typescript data-flow rule playwright, puppeteer

HTML produced by the model is rendered into the automation page with setContent. Script in that HTML runs in the page and can call every function the host exposed to it; a rendered page is also what screenshots and extracted text feed back to the model. Render model output as text, or sanitise it with an HTML sanitiser before setContent.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Escape the model's text and insert it into a fixed template, or pass it through an HTML sanitiser (DOMPurify, sanitize-html) before page.setContent; do not expose host functions to a page that renders model HTML.

**References:** [https://playwright.dev/docs/api/class-page#page-set-content](https://playwright.dev/docs/api/class-page#page-set-content) · [https://pptr.dev/api/puppeteer.page.setcontent](https://pptr.dev/api/puppeteer.page.setcontent)

## keryn.browseragent.model-output-to-page-html-py

`warning` python data-flow rule playwright

HTML produced by the model is rendered into the automation page with set\_content. Script in that HTML runs in the page and can call every function the host exposed to it; a rendered page is also what screenshots and extracted text feed back to the model. Render model output as text, or sanitise it with an HTML sanitiser before set\_content.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Escape the model's text and insert it into a fixed template, or pass it through an HTML sanitiser (bleach, nh3) before page.set\_content; do not expose host functions to a page that renders model HTML.

**References:** [https://playwright.dev/python/docs/api/class-page#page-set-content](https://playwright.dev/python/docs/api/class-page#page-set-content)

## keryn.browseragent.page-content-in-system-prompt-js

`warning` javascript, typescript data-flow rule playwright, puppeteer, anthropic, openai, vercel-ai-sdk

Text or HTML read from a web page (content, innerText, evaluate, $eval) is placed in the model's system prompt or instructions. Anything written on that page then speaks with system authority to the agent: hidden text can redirect its goal, exfiltrate the task context or trigger tool calls. Put page content in a user-role message inside a clearly delimited data block and keep the system prompt fixed.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-1427](https://keryn.dev/taxonomies/cwe/#cwe-1427-improper-neutralization-of-input-used-for-llm-prompting) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Keep system/instructions constant; pass page text as a user message wrapped in explicit delimiters ("&lt;page\_content&gt;" ...), tell the model it is untrusted data, truncate it, and never let it carry tool-call permissions.

**References:** [https://playwright.dev/docs/api/class-page#page-content](https://playwright.dev/docs/api/class-page#page-content) · [https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/system-prompts](https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/system-prompts) · [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/)

## keryn.browseragent.page-content-in-system-prompt-py

`warning` python data-flow rule playwright, anthropic, openai, google-genai, langchain

Text or HTML read from a web page (content, inner\_text, evaluate) is placed in the model's system prompt or instructions. Anything written on that page then speaks with system authority to the agent: hidden text can redirect its goal, exfiltrate the task context or trigger tool calls. Put page content in a user-role message inside a clearly delimited data block and keep the system prompt fixed.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-1427](https://keryn.dev/taxonomies/cwe/#cwe-1427-improper-neutralization-of-input-used-for-llm-prompting) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Keep system/instructions constant; pass page text as a user message wrapped in explicit delimiters, tell the model it is untrusted data, truncate it, and never let it carry tool-call permissions.

**References:** [https://playwright.dev/python/docs/api/class-page#page-content](https://playwright.dev/python/docs/api/class-page#page-content) · [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/)

## keryn.browseragent.browser-launch-no-sandbox-js

`warning` javascript, typescript playwright, puppeteer, chromium

The automation browser is launched with the Chromium sandbox disabled (--no-sandbox / --disable-setuid-sandbox). A renderer exploit on any page the agent visits then runs as the host process, with the agent's credentials and files. Run the browser with the sandbox on; in containers, use a user namespace or a seccomp profile instead of disabling it.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove --no-sandbox and --disable-setuid-sandbox from the launch args; run as a non-root user (the sandbox refuses root), and in Docker use the official Playwright image or a seccomp profile that allows user namespaces.

**References:** [https://chromium.googlesource.com/chromium/src/+/main/docs/design/sandbox.md](https://chromium.googlesource.com/chromium/src/+/main/docs/design/sandbox.md) · [https://pptr.dev/troubleshooting](https://pptr.dev/troubleshooting) · [https://playwright.dev/docs/api/class-browsertype#browser-type-launch](https://playwright.dev/docs/api/class-browsertype#browser-type-launch)

## keryn.browseragent.browser-launch-no-sandbox-py

`warning` python playwright, chromium

The automation browser is launched with the Chromium sandbox disabled (--no-sandbox / --disable-setuid-sandbox or chromium\_sandbox=False). A renderer exploit on any page the agent visits then runs as the host process, with the agent's credentials and files. Run the browser with the sandbox on; in containers, use a user namespace or a seccomp profile instead of disabling it.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove --no-sandbox and --disable-setuid-sandbox from args and keep chromium\_sandbox at its default; run as a non-root user, and in Docker use the official Playwright image or a seccomp profile that allows user namespaces.

**References:** [https://chromium.googlesource.com/chromium/src/+/main/docs/design/sandbox.md](https://chromium.googlesource.com/chromium/src/+/main/docs/design/sandbox.md) · [https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch)

## keryn.browseragent.browser-launch-disable-web-security-js

`error` javascript, typescript playwright, puppeteer, chromium

The automation browser is launched with --disable-web-security, which turns off the same-origin policy. Any page the agent visits can then read responses from every other origin the browser can reach, including logged-in internal sites and localhost services, and hand them to the model. Keep the same-origin policy on and use route interception or a proxy for the specific cross-origin need.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-346](https://keryn.dev/taxonomies/cwe/#cwe-346-origin-validation-error) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Remove --disable-web-security (and --disable-site-isolation-trials); for a cross-origin fetch use page.route, a server-side proxy or the API directly from the host process.

**References:** [https://playwright.dev/docs/api/class-browsertype#browser-type-launch](https://playwright.dev/docs/api/class-browsertype#browser-type-launch) · [https://pptr.dev/api/puppeteer.launchoptions](https://pptr.dev/api/puppeteer.launchoptions)

## keryn.browseragent.browser-launch-disable-web-security-py

`error` python playwright, chromium

The automation browser is launched with --disable-web-security, which turns off the same-origin policy. Any page the agent visits can then read responses from every other origin the browser can reach, including logged-in internal sites and localhost services, and hand them to the model. Keep the same-origin policy on and use route interception or a proxy for the specific cross-origin need.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-346](https://keryn.dev/taxonomies/cwe/#cwe-346-origin-validation-error) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Remove --disable-web-security (and --disable-site-isolation-trials); for a cross-origin fetch use page.route, a server-side proxy or the API directly from the host process.

**References:** [https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch)

**Try it: a snippet that triggers this rule**

Written for this page, not taken from any project. Save it as `scraper/session.py` and scan it with `keryn scan scraper --verbose`; the finding below appears.

```python
from playwright.sync_api import sync_playwright

def open_dashboard(url: str) -> str:
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True, args=["--disable-web-security", "--window-size=1280,900"])
        page = browser.new_page()
        page.goto(url)
        title = page.title()
        browser.close()
        return title
```

Checked with Keryn's browser engine when this page was built: it reports `keryn.browseragent.browser-launch-disable-web-security-py` at line 6 (error, proof 1). The rule's own logic is not published, so it cannot run in this tab; the pack list in the [playground](https://keryn.dev/playground/) shows what does.

## keryn.browseragent.browser-ignore-https-errors-js

`warning` javascript, typescript playwright, puppeteer

The automation browser accepts invalid TLS certificates (ignoreHTTPSErrors / acceptInsecureCerts). An agent that browses with this setting can be redirected to a spoofed site by anyone on the network path, and every credential it types or cookie it carries goes to the impostor. Keep certificate validation on; trust a specific test CA instead.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-295](https://keryn.dev/rules/?cwe=CWE-295) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Drop ignoreHTTPSErrors / acceptInsecureCerts; install the test CA in the browser profile (or use the --ignore-certificate-errors-spki-list flag with the pinned SPKI hash) when a local service must be reached over a self-signed certificate.

**References:** [https://playwright.dev/docs/api/class-browser#browser-new-context-option-ignore-https-errors](https://playwright.dev/docs/api/class-browser#browser-new-context-option-ignore-https-errors) · [https://pptr.dev/api/puppeteer.launchoptions](https://pptr.dev/api/puppeteer.launchoptions)

## keryn.browseragent.browser-ignore-https-errors-py

`warning` python playwright

The automation browser accepts invalid TLS certificates (ignore\_https\_errors=True). An agent that browses with this setting can be redirected to a spoofed site by anyone on the network path, and every credential it types or cookie it carries goes to the impostor. Keep certificate validation on; trust a specific test CA instead.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-295](https://keryn.dev/rules/?cwe=CWE-295) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Drop ignore\_https\_errors; install the test CA in the browser profile when a local service must be reached over a self-signed certificate.

**References:** [https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-ignore-https-errors](https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-ignore-https-errors)

## keryn.browseragent.browser-agent-uses-personal-profile-js

`warning` javascript, typescript playwright, puppeteer

The automation browser is started on a real user profile directory (Chrome, Chromium, Brave or Edge under the user's Library / AppData / .config). The agent then browses with the owner's logged-in sessions, saved passwords and extensions, so a prompt-injected page can act as the owner on any site and read whatever those sessions can. Give the agent a dedicated, empty profile and log in to only what the task needs.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-522](https://keryn.dev/taxonomies/cwe/#cwe-522-insufficiently-protected-credentials) [CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Point userDataDir / launchPersistentContext at a directory created for the agent (or use an ephemeral context) and provision only the sessions the task needs; never the default Chrome profile.

**References:** [https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context) · [https://pptr.dev/api/puppeteer.launchoptions](https://pptr.dev/api/puppeteer.launchoptions)

## keryn.browseragent.browser-agent-uses-personal-profile-py

`warning` python playwright, browser-use

The automation browser is started on a real user profile directory (Chrome, Chromium, Brave or Edge under the user's Library / AppData / .config). The agent then browses with the owner's logged-in sessions, saved passwords and extensions, so a prompt-injected page can act as the owner on any site and read whatever those sessions can. Give the agent a dedicated, empty profile and log in to only what the task needs.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-522](https://keryn.dev/taxonomies/cwe/#cwe-522-insufficiently-protected-credentials) [CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Point launch\_persistent\_context / user\_data\_dir at a directory created for the agent (or use an ephemeral context) and provision only the sessions the task needs; never the default Chrome profile.

**References:** [https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context) · [https://docs.browser-use.com/cloud/quickstart](https://docs.browser-use.com/cloud/quickstart)

## keryn.browseragent.browser-agent-attaches-to-live-browser-js

`warning` javascript, typescript playwright, puppeteer, cdp

The agent attaches to an already running browser over the DevTools protocol (connectOverCDP, puppeteer.connect, or a --remote-debugging-port launch flag). That browser is usually the owner's, with every logged-in session, and the debugging port has no authentication: any local process can drive it too. Launch a dedicated browser for the agent; if a CDP endpoint is unavoidable, bind it to localhost, keep the port private and close it when the task ends.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-306](https://keryn.dev/taxonomies/cwe/#cwe-306-missing-authentication-for-critical-function) [CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Prefer launch() with a dedicated profile; when attaching is required, start the target browser with --remote-debugging-address=127.0.0.1 and a random port, never expose it beyond the host, and never attach to the owner's daily browser.

**References:** [https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp](https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp) · [https://pptr.dev/api/puppeteer.connectoptions](https://pptr.dev/api/puppeteer.connectoptions) · [https://chromedevtools.github.io/devtools-protocol/](https://chromedevtools.github.io/devtools-protocol/)

## keryn.browseragent.browser-agent-attaches-to-live-browser-py

`warning` python playwright, browser-use, cdp

The agent attaches to an already running browser over the DevTools protocol (connect\_over\_cdp, a cdp\_url, or a --remote-debugging-port launch flag). That browser is usually the owner's, with every logged-in session, and the debugging port has no authentication: any local process can drive it too. Launch a dedicated browser for the agent; if a CDP endpoint is unavoidable, bind it to localhost, keep the port private and close it when the task ends.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-306](https://keryn.dev/taxonomies/cwe/#cwe-306-missing-authentication-for-critical-function) [CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Prefer launch() with a dedicated profile; when attaching is required, start the target browser with --remote-debugging-address=127.0.0.1 and a random port, never expose it beyond the host, and never attach to the owner's daily browser.

**References:** [https://playwright.dev/python/docs/api/class-browsertype#browser-type-connect-over-cdp](https://playwright.dev/python/docs/api/class-browsertype#browser-type-connect-over-cdp) · [https://docs.browser-use.com/cloud/quickstart](https://docs.browser-use.com/cloud/quickstart)

## keryn.browseragent.host-function-exposed-to-page-js

`warning` javascript, typescript playwright, puppeteer

A host function is exposed to page JavaScript (exposeFunction / exposeBinding). Every page the agent visits, including ones a prompt-injected URL chose, can call it with arbitrary arguments; if it touches files, shells, secrets or the model, the page now does too. Expose nothing to untrusted pages, or expose a narrow function that validates its arguments and checks the calling frame's origin.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **high**: it finds a lead to confirm, so expect benign hits.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-749](https://keryn.dev/rules/?cwe=CWE-749) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove the exposure for agent browsing sessions, or use exposeBinding and check source.frame.url() against an allowlist before doing anything; validate every argument and never pass them to shells, file APIs or the model as instructions.

**References:** [https://playwright.dev/docs/api/class-page#page-expose-function](https://playwright.dev/docs/api/class-page#page-expose-function) · [https://playwright.dev/docs/api/class-browsercontext#browser-context-expose-binding](https://playwright.dev/docs/api/class-browsercontext#browser-context-expose-binding) · [https://pptr.dev/api/puppeteer.page.exposefunction](https://pptr.dev/api/puppeteer.page.exposefunction)

## keryn.browseragent.host-function-exposed-to-page-py

`warning` python playwright

A host function is exposed to page JavaScript (expose\_function / expose\_binding). Every page the agent visits, including ones a prompt-injected URL chose, can call it with arbitrary arguments; if it touches files, shells, secrets or the model, the page now does too. Expose nothing to untrusted pages, or expose a narrow function that validates its arguments and checks the calling frame's origin.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **high**: it finds a lead to confirm, so expect benign hits.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-749](https://keryn.dev/rules/?cwe=CWE-749) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove the exposure for agent browsing sessions, or use expose\_binding and check source["frame"].url against an allowlist before doing anything; validate every argument and never pass them to shells, file APIs or the model as instructions.

**References:** [https://playwright.dev/python/docs/api/class-page#page-expose-function](https://playwright.dev/python/docs/api/class-page#page-expose-function) · [https://playwright.dev/python/docs/api/class-browsercontext#browser-context-expose-binding](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-expose-binding)

## keryn.browseragent.mcp-browser-server-attached-to-user-browser

`warning` json mcp, playwright, claude-code, cursor, vscode

A browser MCP server is configured to drive the user's own browser (--cdp-endpoint, --extension, or --user-data-dir on a real profile) rather than an isolated one. Every model turn can then act with the user's logged-in sessions, and a prompt-injected page reaches the same accounts. Run the browser server isolated (--isolated, or a dedicated profile) and sign in to only the sites the task needs.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-306](https://keryn.dev/taxonomies/cwe/#cwe-306-missing-authentication-for-critical-function) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

**Fix:** Remove --cdp-endpoint / --extension and any --user-data-dir that names a daily-use profile; use --isolated with --storage-state for the sessions the task needs, or a profile directory created for the agent.

**References:** [https://github.com/microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) · [https://code.claude.com/docs/en/mcp](https://code.claude.com/docs/en/mcp)

## keryn.browseragent.mcp-browser-server-sandbox-or-tls-off

`warning` json mcp, playwright, claude-code, cursor, vscode

A browser MCP server is configured with the Chromium sandbox or TLS validation turned off (--no-sandbox, --ignore-https-errors). Pages the model navigates to run with host privileges or can be spoofed on the network path. Remove the flag; run as a non-root user and trust a specific CA instead.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-295](https://keryn.dev/rules/?cwe=CWE-295) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Drop --no-sandbox and --ignore-https-errors from the server's args; run the MCP server as a non-root user and install the test CA in the agent's browser profile when a self-signed local service is needed.

**References:** [https://github.com/microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp)
