HIGH AI PREVALENCE: MEDIUM auth.ruby.jwt.algorithm-none
A JWT is encoded or decoded with the none algorithm, which produces (and accepts) unsigned tokens.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
Anyone can craft a token with any claims and it will be trusted, because there is no signature to verify (CWE-347). This shows up in AI-generated "quick token" and debugging code that then ships.
Sign with a real algorithm and a key from configuration: JWT.encode(payload, ENV.fetch('JWT_SECRET'), 'HS256') JWT.decode(token, key, true, { algorithm: 'HS256' })
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.jwt.algorithm-none -- <reason>