Repository navigation
feat(rules): detect open redirects in redirect-shaped params (repo#1936) - #1881
Merged
Merged
Conversation
nc9
marked this pull request as ready for review
November 14, 2026 23:13
nc9
force-pushed
the
boat/open-redirect-1936
branch
3 times, most recently
from
November 15, 2026 03:56
8fdccf3 to
d6e7ed9
Compare
Contributor
Author
|
Review requirement (2026-11-15, from #1920): a probe answered with 429, a 401/403 bot challenge, an HTML challenge page (cf-mitigated, Cloudflare or WAF challenge markers), 5xx or a timeout must make the target UNVERIFIED. The rule then reports not checked or incomplete, never passed. Only a genuine 404, or a non-challenge answer, counts as not exposed. Please add a stub test for a 429 and for a 403 HTML challenge. |
Add security/open-redirect, a site-scoped quiet probing rule that runs at --probe active or above inside the shared probe budget. It finds same-origin URLs whose query carries a redirect-shaped parameter (next, url, redirect, return, returnTo, returnUrl, dest, continue, r and the like) in crawled page URLs, internal links and discovered GET endpoints, and sends GET requests with that parameter set to https://squirrelscan-redirect-probe.invalid/ and then //squirrelscan-redirect-probe.invalid/. It warns only when a 3xx Location resolves to that host. Redirects are never followed and bodies are never read; state-changing paths (isStateChangingPath) and non-GET call sites are never requested; robots.txt is respected below aggressive; at most ten parameters per run. Findings name the page and the parameter, not the query string. Passive runs record one skipped check and send nothing. Docs: rule page, security hub, rules index, README and docs/index.mdx tables, probing config table, CHANGELOG. Canonical golden and finding messages pin one more skipped row (329 rules). Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
boat/open-redirect-1936
branch
from
November 17, 2026 02:26
d6e7ed9 to
e46f704
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
security/open-redirect, a quiet probing rule next to the GraphQL probes, inside the shared probe budget and the--probelevels frompackages/config/src/probe.ts. Implements squirrelscan/repo#1936 (private issue; it closes when the gitlink bump lands).What it does
next,url,redirect,redirect_url,redirect_to,return,returnUrl,returnTo,return_path,dest,destination,continue,goto,r, matched ignoring case,_and-). They come from crawled page URLs, internal links, and discoveredGETendpoints and form actions (ctx.endpointSurface). Deduped on path + param name, at most 10 per run.isStateChangingPath, e.g./logout?next=), a discovered call site that declares any non-GET method, or a robots-disallowed path belowaggressive.GETwith only that param set tohttps://squirrelscan-redirect-probe.invalid/. If that is not redirected off-site, a secondGETwith//squirrelscan-redirect-probe.invalid/follows. Settings:credentials: "omit",redirect: "manual"; the body is never read..invalidnever resolves.Locationresolves to the canary host. A redirect to the same origin, a redirect to another (allowlisted) host, a 4xx or a 200 echo is not a finding.active(or with noctx.probe): no request is sent, and the rule records one skipped check (probing-passive) saying to run with--probe active. When the budget runs out, or every probe errors, the rule records a skipped check, never a pass.Acceptance criteria (repo#1936)
open-redirect candidate selectiontests (same-origin only, deduped, name matching), and thepage-url/linksources in the rule tests. Forms reach the rule through endpoint discovery's GET form actions.a vulnerable param is flagged with the page and the param, from the absolute form.the protocol-relative bypass is tried when the absolute form is refused;/\hostinclassifyRedirect.an allowlisted redirect, a same-origin-only redirect, a rejection and a 200 echo are not flagged.the redirect is never followed(a real local server sees no request to the Location target),probes are capped per run,an exhausted budget sends nothing more and is not a pass,state-changing paths and non-GET call sites are never requested,below the active level: no request, and a not-checked result. A mutation check that switched the request toredirect: "follow"failed 4 of the 13 tests.Gates
packages/rules:bun run typecheckclean.packages/audit-engineandpackages/utilstypecheck clean.oxlint(CLI config) on the new files: clean.bun test packages/rules/tests/open-redirect.test.ts: 13 pass.packages/audit-engine:streaming-rules-canonical-golden.test.ts1 pass (findings 109735 -> 109736, rules 328 -> 329, one skipped row because the gate is passive).golden-finding-messages-229.test.ts3 pass afterUPDATE_GOLDEN=1; the diff is one skipped line.docs/:make validate: tangly strict passed, links ok, glossary ok, rule-checks ok, 62 pass.Docs
New
docs/rules/security/open-redirect.mdx, plus updates to the security hub row and count (25), the rules index card, the README anddocs/index.mdxSecurity rows, the probing rules table inconfiguration/security.mdx, the offline note incli/audit.mdx, the nav, and CHANGELOG (Unreleased > Added).Agent skill
No change needed: the skill reads rule output generically and documents
--probealready. The new rule appears through the existing rules listing.