Insecure Cookie (ARCH6123)
Esta página aún no está disponible en tu idioma.
Key ruby.security.insecure-cookie · Severity warning · Category security · CWE CWE-614
Cookies without the Secure flag can be sent over unencrypted HTTP and intercepted by network eavesdroppers. Always set Secure on sensitive cookies.
Incorrect
Section titled “Incorrect”class SessionsController < ApplicationController def create cookies[:auth] = { value: token, httponly: true } endendCorrect
Section titled “Correct”class SessionsController < ApplicationController def create cookies[:auth] = { value: token, httponly: true, secure: true, same_site: :lax } endendSet sensitive cookies with secure: true so they are only transmitted over HTTPS.