HIGH AI PREVALENCE: MEDIUM auth.csharp.cookie.secure-policy-none
A cookie policy is set to SecurePolicy = CookieSecurePolicy.None, which lets authentication and session cookies be sent over plain HTTP.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
On any non-HTTPS hop an on-path attacker can read the cookie and hijack the session (CWE-614). This is a common AI-generated shortcut to get cookies working over http://localhost that then ships to production.
Use CookieSecurePolicy.Always so the Secure attribute is set and the cookie is only transmitted over HTTPS. Prefer Always over SameAsRequest for auth cookies.
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.csharp.cookie.secure-policy-none -- <reason>