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.
Why this matters
Any claims read from the result are fully attacker-controlled: an attacker can forge arbitrary subjects, scopes, or expiry and the token will still parse. Trusting these claims for authentication or authorization is a complete auth bypass (CWE-347).
Verify the signature instead: use jwt.Parse(tok, keyfunc) or jwt.ParseWithClaims(tok, claims, keyfunc) with a Keyfunc that returns the expected signing key, so a token with a bad or missing signature is rejected.
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.