Skip to content

fix(cli): only http(s) start URLs are registered as cloud runs - #1321

Closed
nc9 wants to merge 5 commits into
mainfrom
fix/register-http-url-only
Closed

nc9 wants to merge 5 commits into
mainfrom
fix/register-http-url-only

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The start URL is validated once, at the top of squirrel audit and of the MCP audit_website tool, before any cloud client, balance read, trace upload or log line. Only http:// or https:// with a host is accepted. Refused: other schemes, a scheme without slashes (mailto:, javascript:[email protected], tel:, data:), no host, junk. host:port (localhost:3000) still works. The MCP tool answers invalid_url without echoing the URL; the CLI exits 1. registerRun and planMcpAudit repeat the check.

parseUserUrl now drops credentials (user:password@) and the fragment from the URL it returns, so they never reach the crawl, logs, register or any cloud call (asserted across every request body of an MCP run). A note on stderr points to --header for basic-auth sites. The query is kept: it is part of the audited URL. Its error no longer echoes the input. Port 0 is refused. parseUserUrl is shared, so squirrel crawl and the private cloud runtime (packages/cloud-audit-runtime) also stop sending Basic auth from URL userinfo after the next gitlink bump. A URL over 2048 characters is audited but not registered (the endpoint 400s it).

Tests (failing first): a CLI subprocess test, signed in, telemetry on, API and proxy pointed at a counting server: refused forms make no request except the startup install ping (POST /v1/installs, sent before the command parses, carries no URL); an MCP counting fake asserting zero /v1/ requests; parseUserUrl unit tests; a source guard that registerRun validates before its first request and is the only poster to /register.

Skill change needed: no. Docs updated (cli/audit, cli/mcp).

nc9 added 5 commits October 30, 2026 13:49
…ed before any cloud request

Signed-off-by: Nik Cubrilovic <[email protected]>
…op credentials and fragment once in parseUserUrl; refuse scheme-without-slashes

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9 nc9 mentioned this pull request Oct 30, 2026
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.143 as 636b3e51 a999b714 0ba88a37 185b7ac6 e817cbab via #1341. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.143. Closing this original.

nik

@nc9 nc9 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant