MEDIUM AI PREVALENCE: MEDIUM auth.express.cookie-insecure
An Express session cookie is explicitly configured as insecure.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
Setting secure: false lets the browser send the session cookie over plain HTTP, and httpOnly: false exposes it to document.cookie (any XSS reads it).
Either drop the flag (the framework default may still need hardening) or set secure: true and httpOnly: true for production. If you need insecure cookies in dev, gate the value on NODE_ENV !== 'production' rather than hard-coding false.
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.express.cookie-insecure -- <reason>