Insecure Cookie Low

Cookies should always be created with the HttpOnly and Secure flags to prevent interception and theft. The HttpOnly flag disables client-side JavaScript access to mitigate XSS threats. The Secure flag restricts transmission to HTTPS connections to prevent MITM eavesdropping. Failing to set these flags when creating cookies with http.Cookie or gorilla/sessions leaves them vulnerable regardless of current contents. All cookies should be HttpOnly to prevent JavaScript access. Sensitive session and auth cookies should also be Secure to block MITM snooping. Enabling cookie security flags is essential to limit exposure and misuse.

Detector ID
go/insecure-cookie@v1.0
Category
Common Weakness Enumeration (CWE) external icon