MEDIUM AI PREVALENCE: MEDIUM auth.ruby.oauth.doorkeeper-insecure-config
A Doorkeeper (OAuth provider) initializer weakens a core protection: force_ssl_in_redirect_uri false allows plaintext http:// redirect URIs (authorization codes/tokens travel in cleartext and are open to interception/redirect tampering, CWE-601); allow_blank_redirect_uri true accepts clients with no registered redirect URI; and an unconditional skip_authorization do true end auto-approves EVERY client with no user consent.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
These are frequent LLM shortcuts to get a local OAuth flow working.
Keep force_ssl_in_redirect_uri on (default) so redirect URIs must be HTTPS, require every client to register a redirect URI, and make skip_authorization conditional on a trusted first-party client rather than returning a bare true, e.g. skip_authorization { |resource_owner, client| client.application.trusted? }.
VULNERABLE
SAFE
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.doorkeeper-insecure-config -- <reason>