redirect_to target taken directly from params
Part of Security, which counts for 30% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
redirect_to is given a params value with no allowlist or host check, so a client can send visitors from this trusted domain to any URL of their choosing: a classic open-redirect phishing setup.
Why it matters
redirect_to built directly from a params value with no validation lets a client construct a link on this trusted domain that actually sends the visitor to any destination the client chooses. This is the standard open-redirect setup used in phishing: the link shows a trusted hostname right up until the redirect fires.
How to fix it
Validate the destination before redirecting: check it against an allowlist of known-safe paths, or restrict it to same-host relative paths only, and fall back to a safe default (the root path, or back) when the value does not qualify. Rails' url_for and a Rack::Utils.escape_path helper can help build a safe target, but the allowlist check is the part that actually prevents an open redirect.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo