HIGH AI PREVALENCE: HIGH auth.fastify.cookie-session-secret
@fastify/cookie, @fastify/session, or @fastify/secure-session is registered with a hard-coded secret string literal.
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 signs the session/cookie: anyone who reads it from your source or git history can forge signed cookies and impersonate any user.
Load it from the environment (fastify.register(fastifySession, { secret: process.env.SESSION_SECRET })) or a secret manager, and add a placeholder to .env.example. The secret must be at least 32 characters. Rotate the leaked value out of 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.fastify.cookie-session-secret -- <reason>