The Echo JWT middleware (labstack/echo-jwt) is configured with a hardcoded string-literal SigningKey.
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). An empty key ([]byte("")) is worse still. It accepts trivially forged tokens. LLMs commonly inline []byte("secret") so the middleware "just works".
Load the key from configuration or a secret store: e.Use(echojwt.WithConfig(echojwt.Config{ SigningKey: []byte(os.Getenv("JWT_SECRET")), })) Rotate any key already committed.
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.echojwt-hardcoded-key -- <reason>