{"slug": "ai-pen-testing-chrome-extension", "title": "AI Pen Testing Chrome Extension", "summary": "A developer has released a Chrome extension (Manifest V3) that captures first-party JavaScript files from a tab and sends them to an OpenAI model to surface server-side attack vectors such as API endpoints, injectable parameters, SSRF/IDOR/SQLi/auth-bypass surface, and leaked secrets, with results shown in a Security Audit panel in Chrome DevTools. The tool is off by default, supports per-tab toggling, configurable scope (same-origin, same-hostname, same-site), and includes features like content-hash caching, large-file chunking, and report export. It requires an OpenAI API key and is available for authorized testing.", "body_md": "A Chrome extension (Manifest V3) that, **when enabled for a tab**, captures every\n**first-party** JavaScript file the site loads and sends it to an OpenAI model\nwith a prompt tuned to surface **server-side attack vectors** — API endpoints,\ninjectable parameters, SSRF/IDOR/SQLi/auth-bypass surface, leaked secrets — plus\nconcrete **routes for further testing**. Results render in a\ndedicated **Security Audit** panel in Chrome DevTools.\n\nI built this tool because it automates the workflow that I usually use to kick off a pentest for a website. It doesn't do anything too fancy, but it saves me a lot of time and I thought others might find it useful as well. Feel free to submit pull requests.\n\n**Per-tab toggle** from the toolbar (and from the panel). Off by default; the content script stays completely idle until you enable a tab.**First-party only.** Third-party CDNs/analytics are ignored. Scope is configurable: same-origin (default), same-hostname, or same-site (eTLD+1, approx).**Server-side focus.** The default prompt treats client JS as a map of the backend and hunts for: reconstructed API/GraphQL/RPC endpoints, injection reaching the server (SQLi/NoSQLi/command/SSTI/XXE), SSRF, IDOR & broken access control, mass assignment, auth weaknesses, path traversal, insecure deserialization, business-logic gaps, and secret/config leakage.**DevTools panel** with per-script cards: overall risk, reconstructed endpoint table, detected secrets, and findings (severity, confidence, CWE, evidence,**testing routes**, and a fix).** Configurable**API key, model (picker + custom id), OpenAI-compatible base URL, concurrency, chunk size, temperature, token budget, inline-script analysis, skip patterns, and a custom system prompt.**Extras:** content-hash result cache (dedupes identical bundles), large-file chunking, a paste-a-snippet analyzer, severity/text filtering, and Markdown/JSON report export.\n\n- Open\n`chrome://extensions`\n\n, enable**Developer mode**. **Load unpacked**→ select this folder.\n\n- Open DevTools (⌥⌘I / F12)\n**Security Audit** tab- gear icon → set your OpenAI\n**API key** and model **Save**.\n\n- Open a site you're authorized to test. Click the toolbar icon →\n**Audit this tab**. - Open DevTools (⌥⌘I / F12)\n**Security Audit** tab\n\nA `document_start`\n\ncontent script (all frames) watches for `<script>`\n\nelements\nand `resource`\n\nperformance entries, fetches first-party script bodies\n(same-origin `fetch`\n\n, so no CORS issues), hashes them, and forwards them to the\nbackground service worker. The worker runs a bounded-concurrency queue of OpenAI\ncalls, caches by content hash, and streams results to the panel over a\nlong-lived port. Because the DevTools panel occupies the tab's debugging\nchannel, capture deliberately avoids `chrome.debugger`\n\nand relies on\ncontent-script fetches instead.\n\n| Permission | Why |\n|---|---|\n`storage` |\nSettings + result cache (`local` ); per-tab runtime state (`session` ). |\n`tabs` |\nResolve the active tab / its origin; message content scripts. |\n`scripting` |\nInject the content script into a tab that was loaded before enabling. |\n`activeTab` |\nGrants host access to the current tab on the toolbar click, so enabling a pre-existing tab can inject and start immediately. |\n`webNavigation` |\nDistinguish real document commits from SPA history/hash changes, so in-app navigation doesn't wipe results. |\n`host_permissions: api.openai.com` |\nCall the OpenAI API from the background/panel. |\n`optional_host_permissions` |\nRequested on demand: the page origin when you enable, a custom base-URL host, and broad host access when you pick a non-origin scope. |\ncontent scripts on `http(s)://*` |\nObserve scripts on the site under test (idle unless enabled; only the top frame and same-origin subframes ever capture). |\n\n- Your API key is stored in\n`chrome.storage.local`\n\non your machine and sent only to the endpoint you configure (default`api.openai.com`\n\n). - First-party script\n**source code** is sent to that endpoint for analysis. Don't enable this on sites whose code you may not submit to a third party. - Script bodies are fetched with\n`credentials: 'omit'`\n\n, so the authenticated / per-user variant of a dynamic script endpoint (which can embed session tokens or PII) is never pulled and forwarded. - Only the\n**top frame and same-origin subframes** capture — scripts inside cross-origin third-party iframes are never read or sent.\n\n```\nmanifest.json\nbackground/service-worker.js   coordination, queue, badge, streaming\ncontent/content-script.js      first-party JS capture (idle until enabled)\npopup/                         toolbar enable/disable + quick stats\ndevtools/                      panel registration + full audit UI\nlib/                           constants, storage, prompt, OpenAI client\nicons/                         icons\n```\n\n- No build step: ES modules load directly (background is a module worker; popup\nand panel pages use\n`<script type=\"module\">`\n\n; the content script is a standalone classic script). - Syntax check:\n`node --check`\n\non each`.js`\n\n, or run the checks in`tools/`\n\n(see below).\n\nThis tool is for legit security testing and research and we are not responsible for any misuse for illegal or unauthorized purposes!", "url": "https://wpnews.pro/news/ai-pen-testing-chrome-extension", "canonical_source": "https://github.com/brianhama/in-browser-sec-audit", "published_at": "2026-08-14 00:00:59+00:00", "updated_at": "2026-08-14 00:11:35.443364+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "artificial-intelligence"], "entities": ["OpenAI", "Chrome", "DevTools"], "alternates": {"html": "https://wpnews.pro/news/ai-pen-testing-chrome-extension", "markdown": "https://wpnews.pro/news/ai-pen-testing-chrome-extension.md", "text": "https://wpnews.pro/news/ai-pen-testing-chrome-extension.txt", "jsonld": "https://wpnews.pro/news/ai-pen-testing-chrome-extension.jsonld"}}