MEDIUM AI PREVALENCE: HIGH auth.cookie.no-httponly
A session/auth cookie is being set WITHOUT the HttpOnly flag.
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
Any XSS that lands on a page in the same origin will be able to read this cookie via document.cookie and exfiltrate the session.
Set { httpOnly: true } on every authentication cookie. If a front-end framework genuinely needs to read it from JS, that is a design problem. Server-side state is the right answer.
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.cookie.no-httponly -- <reason>