If you discover a security vulnerability, please report it responsibly. Do not open a public issue.
- Open a private GitHub Security Advisory on this repository. Private vulnerability reporting is enabled, so the "Report a vulnerability" button on the Security tab opens the same form.
- If the advisory form is unavailable to you, open a public issue titled "Security contact request" with no technical detail. The maintainer will reply with a private channel.
- Encrypt sensitive disclosures if you can. Request the maintainer's PGP key in the advisory thread; the fingerprint is shared there on first request and rotated yearly.
When reporting, please include:
- A short description of the issue and the impact you believe it has.
- A minimal reproducer (URL, command line, payload, or short script).
- Affected versions and platforms.
- Whether you have a suggested fix.
claude-seo follows a 90-day coordinated disclosure policy.
| Day | Event |
|---|---|
| 0 | Maintainer acknowledges receipt. |
| ≤ 3 | Initial triage: severity classification (CVSS v3.1) and reproducibility confirmation. |
| ≤ 14 | Mitigation or fix candidate proposed. |
| ≤ 30 | Fix released in a patch version or backport; reporter credited in the release notes (opt-out available). |
| ≤ 90 | Public advisory published if not earlier. |
If a fix cannot be shipped within 90 days, the maintainer will request an extension with a clear technical reason. The reporter retains the right to disclose at the 90-day mark.
| Version line | Status | Notes |
|---|---|---|
| 2.x | ✅ Fully supported | Active development; security and bug fixes. |
| 1.9.x | ✅ Patch-only for security | Final 1.x line; only CVSS ≥ High issues backported. |
| < 1.9 | ❌ Unsupported | Please upgrade. |
claude-seo is a research and audit toolkit that runs on a user's workstation. It accepts user-supplied URLs and credentials, and issues HTTP requests against arbitrary internet hosts. The threat model has four primary attacker types:
-
Malicious audit target. A site the user points claude-seo at attempts to leak local-network or cloud-metadata data via SSRF chains: private IP literals, decimal/hex/octal IPv4, FQDN trailing dot, 30x redirects to private IPs, DNS rebinding (initial public resolution → later private), IPv4-mapped IPv6, dual-stack hosts with one private record.
Mitigation:
scripts/url_safety.pyis the canonical pre-flight + DNS-pinned fetch layer. Every script that fetches a user-supplied or page-derived URL validates through it. Calls to fixed vendor API hosts (Google, Bing, Moz, Common Crawl, GitHub, DataForSEO) go to those hosts directly. Seetests/test_url_safety.pyfor the regression suite covering each bypass class.Browser fetches (
render_page.py,capture_screenshot.py,analyze_visual.py) launch Chromium only throughbrowser_proxy.guarded_chromium. Every Chromium connection, including each redirect hop, subresource, WebSocket and loopback address, is forced through a local proxy that validates the destination with the same policy and connects only to an address that passed it (when a host has several, each validated address is tried in turn, without resolving again). The proxy requires a random per-run credential that only that browser is given. QUIC and non-proxied WebRTC UDP are disabled. A render that ends on a blank page, a browser error page or a non-public address is reported as an error, never as the audited page.unlighthouse_run.pygives Chrome the same proxy and preloadsunlighthouse_http_proxy.cjsso the Unlighthouse CLI's own Node requests (site check, robots.txt, sitemaps) go through it too. Seetests/test_browser_proxy.py.Chromium is launched with its sandbox wherever the host can start it, so a renderer exploit in a hostile page is contained by the browser sandbox there. Where the sandbox cannot start (Ubuntu 23.10 and later, whose AppArmor policy blocks unprivileged user namespaces; GitHub's Ubuntu runners; most Docker images; root) the browser is launched once more without it, behind the same egress guard. That decision is made once, on the launch error, before any page is loaded; nothing a page does later can trigger it. Every unsandboxed run prints a warning on stderr with the reason, and the JSON results of the three scripts carry
sandbox: false.CLAUDE_SEO_CHROMIUM_REQUIRE_SANDBOX=1is strict mode: no fallback, the launch fails with an error instead.CLAUDE_SEO_CHROMIUM_NO_SANDBOX=1skips the sandbox attempt; with both set, strict mode wins and the launch fails. -
Tampered install. A modified plugin install, GitHub release, or manual install script could deliver altered files. Plugin install is the default path; the manual path clones the repository, or downloads
install.shto a file to review before running it, so signature verification of release artifacts remains a defence-in-depth concern.Mitigation status: SHA-256 manifest tooling (
scripts/release_sign.py,scripts/verify_release.py) shipped in v2.0.0, but the install scripts do not verify a manifest yet and releases do not attach one. Installer verification is planned for a later release; it is not in v2.7.1. Until then, install by cloning the release tag explicitly (git clone --branch vX.Y.Z), check the tag signature, and inspect the diff against the previous release. Release tags are SSH-signed, with one exception:v2.7.0was published as an unsigned lightweight tag and the tag ruleset does not allow moving it, so for that release check the commit instead (d82d348, shown as Verified on GitHub). To verify one locally, put the maintainer's signing key fromhttps://api.github.com/users/AgriciDaniel/ssh_signing_keysin an allowed-signers file as223140489+AgriciDaniel@users.noreply.github.com namespaces="git" <key>, then rungit -c gpg.ssh.allowedSignersFile=<file> tag -v vX.Y.Zand look forGood "git" signature. -
Local privilege escalation against stored credentials. The OAuth token at
~/.config/claude-seo/oauth-token.json(or in theCLAUDE_SEO_PROFILE_DIRdirectory) is the most sensitive on-disk artifact.Mitigation: v2 forces
0o600on every write (os.open+os.fchmod) and remediates legacy0o644files in place on first load. Tokens never contain the OAuthclient_secret, only the access/refresh pair plus expiry metadata. -
Indirect prompt injection and AI-gaming content. Any external content read during an audit is untrusted data, including HTML bodies, hidden or collapsed DOM blocks (such as
.faq,.accordion, or.tab-panelcontainers), HTML comments, meta descriptions, JSON-LD structured data,llms.txtfiles, third-party directory/listing payloads, and SERP snippets. A hostile site may embed hidden directives attempting to inflate audit scores, suppress findings, exfiltrate local secrets, or steer the agent into running unintended tools.Defense controls:
- A read never widens the write. Inspecting or auditing external web content never expands filesystem, shell, credential, or network permissions, never triggers state-changing actions, and never directs tool execution outside the user's explicit request.
- Deterministic AI-directive detection.
scripts/parse_html.pydetects inline CSS hiding (display:none,visibility:hidden,opacity:0,font-size:0,color:transparent,clip:rect(0,0,0,0)) and scans hidden blocks, collapsed panels, HTML comments, meta descriptions, and JSON-LD strings for high-precision AI-directive / prompt-injection patterns, surfacing bounded matches underhidden_text["ai_directives"].scripts/page_checks.pyruns a matching deterministicai-directive-textcheck (Highseverity) with control-stripped, 200-character-bounded evidence. - Control-character and bidi sanitization. Extracted text fields (
title,meta_description, headings, imagealt, hidden-text samples, and check evidence) strip non-whitespace ASCII control characters and Unicode bidirectional override characters (U+202A-U+202E,U+2066-U+2069,U+200E,U+200F), and bound output lengths and counts. - Untrusted-data boundary. Quoted text in parser output, findings, and reports is always treated as untrusted page data, never as instructions.
-
Limits of the browser egress guard. The guard covers everything Chromium sends through its proxy settings: HTTP, HTTPS and WebSocket connections, with redirects checked at connect time. It relies on Chromium honouring
--proxy-serverand--proxy-bypass-list=<-loopback>; the Playwrightroute()handler (make_safe_playwright_route_handler) and the blocked service workers and WebSockets stay in place as a second layer. The Unlighthouse preload covers Node'shttpandhttpsmodules only; Unlighthouse's version check usesfetchand goes to GitHub directly. The guard listens on a random loopback port for the length of one run and forwards to public addresses only. For the Playwright scripts it requires a random per-run credential (handed to Chromium through Playwright, never on a command line) and answers anything else with 407. The Unlighthouse guard runs without local credentials because Chrome started with--proxy-servercannot authenticate to a proxy: while an Unlighthouse run lasts, any local process can use that guard to reach public hosts, thoughbrowser_proxy.pyrefuses by default (allow_unauth_upstream_creds=False) to attach operator upstream proxy credentials onto an unauthenticated local guard. Do not run Unlighthouse on a shared machine you do not trust. A plain-HTTP response is relayed with the origin's own framing and the browser connection is reset if the origin fails mid-response; a response head over 256 KiB or 1,000 header lines is answered with a 502. -
HTTP proxies weaken DNS pinning. Behind a configured HTTP proxy (
HTTPS_PROXYand friends) the proxy resolves each host itself, so the pin degrades to validation:validate_url_strictfor the first URL, and the same strict check on every redirect hop before it is sent through the proxy (a refused hop raises an error that is bothURLSafetyErrorand arequestsConnectionError). A host that resolves differently for the proxy than for this machine is outside what that check can see. The proxy host itself is exempted from the pinned scope only after passing the same hostname blocklist andis_safe_ippolicy as an audit target, so a proxy on loopback, RFC 1918, RFC 6598, link-local, or a metadata address is refused rather than exempted, unless the operator names it inCLAUDE_SEO_TRUSTED_PROXIES(see "Trusting a local proxy" below; link-local and metadata stay refused). The browser guard chains to the same proxy under the same rules; it supportshttp://proxies only, and asocksorhttps://proxy URL, or a refused proxy, fails the browser run with an error instead of connecting direct. -
Running without the Chromium sandbox. On a host that cannot start the sandbox (Ubuntu 23.10 and later by default, most containers, root) the browser runs without it by default, with a warning, and so it does with
CLAUDE_SEO_CHROMIUM_NO_SANDBOX=1. A browser exploit served by an audited page then runs with the user's privileges (as root when claude-seo runs as root). The egress guard does not help against that. To rule it out, enable the sandbox on the host (seedocs/TROUBLESHOOTING.md) or setCLAUDE_SEO_CHROMIUM_REQUIRE_SANDBOX=1, which fails the launch instead of rendering unsandboxed. -
IPv6 audit targets. The strict validator resolves both address families and refuses a host if any A or AAAA record is non-public. On the raw-HTTP path the pin is IPv4 when the host has an A record and IPv6 otherwise, with no fallback between families. The browser egress guard tries every validated address of the host, IPv4 first, under one 10 second connect budget. NAT64 (64:ff9b::/96, 64:ff9b:1::/48), 6to4, Teredo, site-local, documentation, ORCHID and zone-scoped addresses are refused. One exception: on a DNS64 network, a synthesized AAAA record under 64:ff9b::/96 is ignored when the host also has an A record, because the pin is then IPv4 and that address is never dialled (the browser guard does not fall back to it either, so an IPv4-only site stays unreachable for the browser on an IPv6-only DNS64 network). A host with no A record gets no such pass, and redirect targets and browser subresources still refuse the prefix.
-
Trusting a local proxy (
CLAUDE_SEO_TRUSTED_PROXIES). A configured proxy on a non-public address is refused by default, on the raw-HTTP path and as the browser guard's upstream. An operator whose only egress is such a proxy (Anthropic-hosted Claude Code cloud sessions use one on 127.0.0.1; cntlm and px are the same case) names it inCLAUDE_SEO_TRUSTED_PROXIES, a comma-separated list ofhostorhost:portentries read from the process environment only. What that does and does not change:- A listed proxy may sit on loopback, RFC 1918, RFC 6598 or IPv6 unique-local space (the code uses the same predicate as
CLAUDE_SEO_LOCAL_TARGETS, which also passes the other non-routable ranges that are not link-local, multicast, unspecified or reserved). Link-local addresses and the metadata endpoints (169.254.169.254,100.100.100.200,192.0.0.192,fd00:ec2::254,fd20:ce::254, themetadata.*names, also in IPv4-mapped or 6to4 form) are refused even when listed. A listed name must resolve only into addresses an entry can reach, public ones included: one link-local or metadata record refuses the whole name.host:porttrusts that port only, compared with the port the connection really uses (80 when anhttp://proxy URL names none). A barehosttrusts that host's proxy on any port, so preferhost:port. - An entry is a hostname or an IP literal with an optional port, nothing else. A scheme, credentials, a path, a CIDR suffix, a wildcard, port 0 or a port over 65535 drops the entry, so a malformed value trusts nothing. An IPv6 address needs brackets to carry a port.
- It names proxies only. It never makes an audit target reachable: the first URL, every redirect hop and every browser request are validated exactly as without it, and a destination equal to the trusted proxy's own address is refused like any other non-public destination. On the raw-HTTP path the proxy's address is reachable on the proxy's own port only, so a redirect that
NO_PROXYsends direct cannot reach another service on that address.CLAUDE_SEO_LOCAL_TARGETSnever trusts a proxy, and this list never allows a target. - Rebinding of the proxy name is covered. The raw-HTTP path re-checks the answer inside the pinned scope at connect time, and the browser guard dials an address that its own check returned, without resolving the name again.
- What you are trusting. The proxy, not claude-seo, makes the final connection and resolves the destination name itself. claude-seo still checks every destination before handing it over: the hostname blocklist, IP literals, and its own DNS lookup of the name, where one non-public record refuses the host (so a machine with no working resolver fails closed instead of skipping the check). It cannot pin the address the proxy then connects to. A name that answers the proxy's resolver differently (split-horizon DNS, or a rebinding answer timed after the check) is reached at whatever address the proxy picks, and the proxy's own egress rules are the only control left. This is the same limit as for a public proxy, described under "HTTP proxies weaken DNS pinning" above; the difference is where the proxy sits. A proxy on loopback or a private network can usually reach that network, so list only a proxy you run or your platform provides, and do not list a general-purpose forward proxy that can reach internal services.
- The browser guard accepts
http://upstream proxies only. A SOCKS orhttps://proxy is refused for browser commands whether or not it is listed. The guard's per-run credential and the Chromium sandbox policy do not change.
- A listed proxy may sit on loopback, RFC 1918, RFC 6598 or IPv6 unique-local space (the code uses the same predicate as
-
Windows file permissions.
os.fchmod(fd, 0o600)is a no-op on Windows for non-ACL filesystems. Users on Windows should rely on per-user directory ACLs instead of POSIX mode bits. All bundled credential writers (scripts/google_auth.py,scripts/backlinks_auth.py,scripts/matomo_auth.py,extensions/profound/scripts/profound_auth.py,extensions/seranking/scripts/seranking_auth.py,extensions/banana/scripts/setup_mcp.py, and the PowerShell extension installers) resolve the current user's Windows SID and applyicacls <temp_path> /inheritance:r /grant:r "*<SID>:F"on the temp file before atomicos.replace/Move-Item(plus load-time remediation of legacy0o644files). This is best-effort only: a failure (missingicacls, a non-NTFS volume, a restricted shell) is logged as a warning and does not block the credential read or write, so on a failure the file's effective protection on Windows falls back to whatever the containing directory's ACLs already provide. -
Scope of
PreToolUse/PostToolUsehooks (hooks/pretool-guard.py,hooks/validate-schema.py). Hooks declared inhooks/hooks.jsonenforce automatically only on Claude Code plugin installs (/plugin install). Manual installs (install.sh,install.ps1) copy hook files on a best-effort basis without registering them in~/.claude/settings.json, and non-Claude-Code harnesses (AGENTS.md) do not executehooks/hooks.json. Gate 3 isolates~/.config/claude-seo/,$CLAUDE_SEO_PROFILE_DIR,$CLAUDE_SEO_CONFIG_DIR,.shopify-env/$SHOPIFY_ENV, and prompts on~/.claude.json,~/.claude/settings.json, and~/.claude/settings.local.jsonacross structured file/search tools (Read,Write,Edit,MultiEdit,NotebookEdit,Grep,Glob), but arbitraryBashcommands, recursive ancestor-directory searches (such as searching from$HOME), and pre-existing filesystem hard links remain outer-sandbox boundaries controlled by Claude Code's permission prompts and OS isolation. Three further limits apply even on plugin installs:- Only two MCP server names are gated. The PostHog read-only gate matches the tool name
mcp__posthog__execand the DataForSEO budget gate matchesmcp__dataforseo__*(letter case is ignored). A server registered under any other name, a claude.ai connector, or a plugin-namespaced server (mcp__plugin_<plugin>_<server>__*) is not matched, so its calls are neither checked nor logged. - Node.js must be on
PATH. Every hook inhooks/hooks.jsonis started throughnode(hooks/run-python-hook.js), including the security and budget guard. Withoutnodethe hook command fails to start, Claude Code treats that as a non-blocking hook error, and the tool call proceeds with no guard. - A hook timeout is not a block. The guard has a 15 second timeout and schema validation 30 seconds. A hook that runs past its timeout is cancelled and the tool call proceeds.
- Only two MCP server names are gated. The PostHog read-only gate matches the tool name
-
RFC 6598 (100.64.0.0/10) is refused by default. Cloud providers serve instance metadata in this range, so
url_safetytreats it like RFC 1918. Tailscale also allocates from it, so a staging site reached over Tailscale is refused under the default policy. The escape hatch isCLAUDE_SEO_LOCAL_TARGETS, a comma-separated allowlist ofhostorhost:portentries (for examplelocalhost:3000,127.0.0.1:8080,100.101.102.103, the last being a Tailscale address). Its scope is deliberately narrow:- It is consulted only for the first, top-level URL passed to
validate_url/validate_url_strict. Redirect targets, embedded subresources, and every request the browser egress guard or the Playwright route handler sees stay fail-closed, so a page served from an allowlisted dev server still cannot pull anything else off the local network. Ahost:portentry holds for the whole request: a redirect to another port on that same host is followed only when the allowlist also names that port. Rendering an allowlisted host through Playwright is therefore not supported; the raw-HTTP path is. - A host must be named exactly. There is no range, wildcard, or "allow private" mode,
host:portmatches that port only, and a barehostmatches any port on that host. - Cloud metadata endpoints are refused even when listed, by name (
metadata.google.internaland its siblings) and by address (169.254.169.254,fd00:ec2::254, and Alibaba's 100.100.100.200, which sits inside the Tailscale range). Link-local, multicast, unspecified, and reserved addresses are never allowlistable. is_safe_ipis unchanged and reads no environment, so every fail-closed path downstream of the first connection is unaffected.- Unset, claude-seo behaves exactly as it did before the flag existed.
- It is consulted only for the first, top-level URL passed to
If you are auditing, these are the high-leverage files:
| File | Purpose |
|---|---|
hooks/pretool-guard.py |
PreToolUse security and cost-control hook (PostHog read-only gate, DataForSEO budget gate, credential-store isolation). |
scripts/url_safety.py |
SSRF / DNS-rebinding canonical module. |
scripts/browser_proxy.py |
Browser egress guard (local validating proxy) and the one sandboxed Chromium launch. |
scripts/unlighthouse_http_proxy.cjs |
Node preload that sends the Unlighthouse CLI's requests through the egress guard. |
scripts/render_page.py |
Shared headless renderer (Playwright + trafilatura). |
scripts/fetch_page.py |
Raw-HTTP fetcher built on url_safety.safe_requests_session. |
scripts/parse_html.py |
Bounded HTML parser, hidden-text / AI-directive detector, and control/bidi sanitizer. |
scripts/page_checks.py |
Deterministic on-page checks including ai-directive-text and evidence sanitization. |
scripts/validate_audit_data.py |
Audit envelope validator (weighted score math, strict unmeasured keyword nulls, fix-kit placeholder checks). |
scripts/capture_screenshot.py |
Playwright screenshot capture behind the egress guard. |
scripts/google_auth.py |
OAuth token lifecycle, chmod 0o600 writes. |
scripts/backlinks_auth.py |
Backlink-API credential loading; SSRF guard via url_safety. |
extensions/profound/scripts/profound_auth.py |
Profound API key credential management (chmod 0o600 writes, isolated config store). |
extensions/seranking/scripts/seranking_auth.py |
SE Ranking API key credential management (chmod 0o600 writes, isolated config store). |
tests/test_url_safety.py |
Regression battery covering every bypass class. |
tests/test_browser_proxy.py |
Egress guard, sandbox launch and page-check regressions. |
- Bugs that require attacker control of the user's machine (any local attacker is already game over).
- Vulnerabilities in upstream dependencies. Please report those to their respective maintainers. We track CVEs in
requirements.txtand bump pins under thedeps:Dependabot stream. - Quality-of-output issues (SEO recommendations, schema errors, etc.). Those are bugs, not security issues.
- No credentials or API keys are committed to this repository.
.gitignoreblocks every known credential filename pattern. - Install scripts write only under
~/.claude/and~/.config/claude-seo/, or under the directory the user sets inCLAUDE_SEO_PROFILE_DIR. - Python dependencies install into an isolated virtual environment. Plugin installs use persistent
CLAUDE_PLUGIN_DATA; manual installs use~/.claude/skills/seo/.venv/. The runtime never falls back to global or user package installation. - Every new fetcher of a user-supplied or page-derived URL must route through
scripts/url_safety.py. There is no exception for "trusted" URLs. - DataForSEO spend caps enforced by
hooks/pretool-guard.pyandscripts/dataforseo_costs.pyare client-side estimates logged onPostToolUse. Because multiple parallel tool calls in one turn evaluatePreToolUsebeforePostToolUsecommits spend, concurrent bursts can exceed the local daily limit by up to the concurrent fan-out cost; set an account-level spend limit in DataForSEO as the hard billing boundary. The budget settings (dataforseo-costs.json: approval mode, threshold, daily limit, warn endpoints) and the spend ledger (dataforseo-ledger.json: timestamp, endpoint name, cost in USD and an optional note per logged call) live in~/.config/claude-seo/(orCLAUDE_SEO_CONFIG_DIR). They are local files, are never transmitted, and sit inside the credential-store directory that Gate 3 isolates. scripts/keyword_discover.py --autocompleteis opt-in and off by default. With the flag it sends up to 15 queries (seed keywords taken from the crawled site or from--seeds, plus question variants) tosuggestqueries.google.comandac.duckduckgo.com, a static two-host allowlist fetched throughscripts/url_safety.py. The audit skill and theseo-clusteragent are instructed to pass the flag only after the user has agreed in the conversation; that is an instruction to the model, not a technical control.