Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    chrome-extension-ai-security-v2

    View as Markdown

    9 rules · Keryn Software Licence · rules 0.8.0 · all packs

    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.

    seceng.chromeext.content-script-dom-to-llm

    Section titled “seceng.chromeext.content-script-dom-to-llm”

    warning javascript, typescript browser-extension

    Chrome extension content script sends page DOM, body text, selection, or document content to an LLM/API endpoint without visible user confirmation.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).

    CWE-200 CWE-359 LLM01 LLM02 ASI01

    seceng.chromeext-openai-from-content-script

    Section titled “seceng.chromeext-openai-from-content-script”

    warning javascript, typescript openai, anthropic, browser-extension

    Content script appears to call OpenAI/Anthropic/LLM provider directly. Extension content scripts should not expose provider keys or send page data without controls.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).

    CWE-200 CWE-798 LLM02 LLM03 ASI03

    warning javascript, typescript browser-extension

    AI provider API key, token, prompt, or chat history is stored in chrome.storage/localStorage without visible encryption or redaction.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reads one thing reads from another.

    CWE-312 CWE-798 LLM02 LLM07 ASI03

    seceng.chromeext-message-handler-missing-sender-check

    Section titled “seceng.chromeext-message-handler-missing-sender-check”

    warning javascript, typescript browser-extension

    Chrome extension runtime message handler performs privileged action without visible sender/origin validation.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-346 LLM06 ASI03 ASI02

    seceng.chromeext-model-output-to-tabs-update

    Section titled “seceng.chromeext-model-output-to-tabs-update”

    warning javascript, typescript browser-extension

    Model/tool output is used as a Chrome tab navigation target without visible URL allowlist validation.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-601 CWE-918 LLM05 LLM06 ASI02

    seceng.chromeext-model-output-to-scripting-exec

    Section titled “seceng.chromeext-model-output-to-scripting-exec”

    warning javascript, typescript browser-extension

    Model/tool output is used in chrome.scripting.executeScript without visible validation. This can enable extension-mediated script injection.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).

    CWE-94 CWE-79 LLM05 LLM06 ASI05 ASI01 ASI02

    warning javascript, typescript browser-extension

    Model/tool output is used as a downloads.download URL or filename without visible validation.

    Confidence P1: dangerous in context. False-positive risk high: it finds a lead to confirm, so expect benign hits.

    Edge inspected: writes one thing writes to another.

    CWE-22 CWE-601 LLM05 LLM06 ASI02 ASI05

    Try it: a snippet that triggers this rule

    Written for this page, not taken from any project. Save it as extension/background.js and scan it with keryn scan extension --verbose; the finding below appears.

    extension/background.js
    import OpenAI from "openai";
    const client = new OpenAI({ apiKey: "from-options" });
    export async function exportFromPrompt(userText) {
    const r = await client.chat.completions.create({
    model: "gpt-4o-mini",
    messages: [{ role: "user", content: userText }],
    tools: [{ type: "function", function: { name: "save", parameters: { type: "object" } } }],
    });
    const call = r.choices[0].message.tool_calls[0];
    const args = JSON.parse(call.function.arguments);
    chrome.downloads.download({ url: args.url, filename: args.filename });
    }

    Checked with Keryn’s browser engine when this page was built: it reports seceng.chromeext-ai-output-to-download at line 13 (warning, proof 1). The rule’s own logic is not published, so it cannot run in this tab; the pack list in the playground shows what does.

    seceng.chromeext-broad-host-permissions-with-ai-endpoint

    Section titled “seceng.chromeext-broad-host-permissions-with-ai-endpoint”

    warning javascript, typescript browser-extension

    Extension uses broad host permissions with AI/provider calls. Broad page access plus LLM exfiltration requires strong consent and minimization.

    Confidence P1: dangerous in context. False-positive risk high: it finds a lead to confirm, so expect benign hits.

    Edge inspected: grants authority is given or left unchecked.

    CWE-200 CWE-250 LLM02 LLM06 ASI03 ASI02

    seceng.chromeext-externally-connectable-broad

    Section titled “seceng.chromeext-externally-connectable-broad”

    warning generic browser-extension

    Extension externally_connectable configuration appears broad. External pages may trigger privileged AI/tool actions.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reaches content or traffic gets to a thing.

    CWE-346 LLM06 ASI03 ASI02