cookie-parser is initialised with a hard-coded string secret (cookieParser('some-secret')).
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
That secret signs every signed cookie (res.cookie(name, val, { signed: true }), read back from req.signedCookies). Anyone who reads it from your source or git history can forge signed cookies and tamper with values your app trusts.
Load the secret from the environment (cookieParser(process.env.COOKIE_SECRET)) or a secret manager, and rotate the leaked value out of source control. Add a placeholder to .env.example so contributors know it is required.
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.express.cookie-parser-secret -- <reason>