HIGH AI PREVALENCE: HIGH auth.session.hardcoded-secret
An express-session / cookie-session secret is a hard-coded 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
The infamous secret: 'keyboard cat' is the canonical AI-generated example. This key signs the session cookie: anyone who reads it from your source or git history can forge arbitrary session cookies and impersonate any user.
Load the secret from the environment (process.env.SESSION_SECRET) or a secret manager, and rotate it out of source control. Add a placeholder to .env.example so contributors know it is required.
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.session.hardcoded-secret -- <reason>