Untrusted request input flows into a 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
Because the target URL is attacker-controlled, this is an open redirect (CWE-601): an attacker can craft a link to your trusted host that bounces the victim to an arbitrary external site. That fuels phishing, and in OAuth flows it can be chained to steal authorization codes or access tokens by sending the victim (and their callback) to a server you do not control.
Never redirect to a raw req.query / req.body / req.params / req.cookies / req.headers value. Validate the destination against an explicit allow-list of hosts or route names, or only allow relative paths you control (reject anything containing a scheme or //).
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.flow.open-redirect -- <reason>