HIGH AI PREVALENCE: HIGH auth.go.cookie.insecure
A session/auth http.Cookie is created with a security attribute explicitly disabled (Secure: false or HttpOnly: false).
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
With Secure: false the cookie is sent over plain HTTP, so a network attacker can read the session token. With HttpOnly: false the cookie is readable from JavaScript, so any XSS can steal it. For OAuth/OIDC this exposes session and token cookies to theft and hijacking.
Set Secure: true and HttpOnly: true on auth cookies, and add an appropriate SameSite mode (for example SameSite: http.SameSiteLaxMode).
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.go.cookie.insecure -- <reason>