Open redirect

From thejefflarson/soundcheck · View interactive version

Open redirect is an AI agent skill from the GitHub repository thejefflarson/soundcheck. Detects redirects to user-controlled URLs that enable phishing and OAuth callback abuse. Use when writing code that redirects users to a URL from request parameters, form input, or any caller-controlled source. Also invoke when building login flows with "return to" URLs or OAuth callback redirects.

How to use this skill

Skill file

Open Redirect Security Check (CWE-601)

What this checks

Protects against open redirect vulnerabilities where an attacker crafts a link that

redirects users from a trusted domain to a malicious site. Used in phishing campaigns

to make malicious links appear legitimate, and in OAuth flows to steal authorization

codes.

Vulnerable patterns

Fix immediately

Flag the vulnerable code and explain the risk. Then suggest a fix that establishes

these properties. Translate each property into the audited file's language and

HTTP framework — use that framework's documented URL-parsing and redirect APIs.

  1. **Every redirect target is either a relative path or a member of an exact

host allowlist.** Parse the URL, inspect the host component, and reject

anything outside the allowlist. Prefix matching is not sufficient.

  1. Scheme-relative URLs are blocked explicitly. A value starting with //

parses as a protocol-relative URL and redirects to whatever host follows.

Checking only for http:// and https:// misses this.

  1. OAuth and login "return-to" parameters go through the same validator as

any other redirect target. These are the highest-value targets because they

run in an authenticated context; a redirect here hands the attacker the

post-login session or an authorization code.

  1. On validation failure, redirect to a safe default (home, dashboard)

rather than echoing an error containing the malicious URL. Echoing it back

gives attackers a reflected-XSS surface.

Verification

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.