HIGH AI PREVALENCE: HIGH auth.go.jwt.hardcoded-secret
A JWT HMAC signing/verification key is hardcoded as a string literal in a call to golang-jwt.
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
Anyone who can read the source or git history can forge or tamper with tokens, which is a complete authentication bypass.
Load the secret from the environment or a secret manager instead, e.g. key := []byte(os.Getenv("JWT_SECRET")) and token.SignedString(key). Never commit signing keys to source control.
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.go.jwt.hardcoded-secret -- <reason>