Untrusted request data flows into an HTTP redirect destination.
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Dataflow rule. This is a taint-mode rule: it traces untrusted request input (query, body, params) through your code to an HTTP redirect destination, so indirection across multiple lines is caught, not just the direct one-line form. Routing the value through a recognised validation / allow-list sanitizer clears the taint and suppresses the finding. Why dataflow →
Why this matters
An attacker who controls the redirect target (via a query parameter, form field, or request header) can forward the victim to an arbitrary external site while the link still appears to point at your trusted domain, a classic open redirect, commonly abused to bypass OAuth redirect_uri checks and to mount convincing phishing.
Do not pass request-derived values straight into http.Redirect(...) or a Location header. Validate the destination against an explicit allow-list, or restrict it to a known relative path (reject absolute URLs, scheme-relative //host values, and back-references) before redirecting. See CWE-601.
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.go.flow.open-redirect -- <reason>