An OmniAuth provider is configured with provider_ignores_state: true, which disables verification of the OAuth state parameter on the callback.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
state is the OAuth CSRF defence: without it, an attacker can splice their own authorization code/response into a victim's session and complete a login/link they did not initiate (CWE-352). This flag exists only as an escape hatch and is a common LLM "fix" for state-mismatch errors caused by a broken session store.
Remove provider_ignores_state: true and fix the real cause (usually a session that is not shared between the request and callback phases, e.g. a cookie store misconfiguration or a load balancer without sticky sessions). Let OmniAuth validate state on every callback.
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.ruby.oauth.omniauth-ignores-state -- <reason>