Untrusted request input flows into the verification key returned by a golang-jwt Keyfunc (or into the WithValidMethods allowlist).
Why AI tools produce this: AI coding tools rarely emit this on their own, but it still slips into assisted edits.
Why this matters
When the attacker controls the key, they sign their own forged token and supply the matching key, so every token "verifies": a complete authentication bypass. When the attacker controls the accepted methods, they can downgrade verification and defeat the signature check (CWE-347, Improper Verification of Cryptographic Signature).
The verification key and the accepted algorithms must be fixed server-side. Return the key from trusted configuration or a vetted key set keyed by a validated kid, and pin accepted methods to a constant allowlist. Never resolve them from r.URL.Query(), r.FormValue, or a request header.
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.jwt.untrusted-verify-key -- <reason>