HIGH AI PREVALENCE: HIGH auth.go.jwt.fiber-hardcoded-key
The Fiber JWT middleware (gofiber/contrib/jwt) is configured with a hardcoded string-literal signing key (SigningKey: jwtware.SigningKey{Key: []byte("...")}).
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
This key verifies every request token; committed to source it lets anyone forge a valid JWT for any user or role, a complete authentication bypass (CWE-798). LLMs commonly inline []byte("secret") so the middleware "just works".
Load the key from configuration or a secret store: app.Use(jwtware.New(jwtware.Config{ SigningKey: jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))}, })) Rotate any key already committed.
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.fiber-hardcoded-key -- <reason>