Insecure cookie (ARCH2123)
Esta página aún no está disponible en tu idioma.
Key python.security.insecure-cookie · Severity warning · Category security · CWE CWE-614
Cookies without the Secure flag are also sent over unencrypted HTTP connections. This lets sensitive session cookies be captured in cleartext on the network.
Incorrect
Section titled “Incorrect”resp = make_response("ok")resp.set_cookie("session", token, httponly=True, secure=False)return respCorrect
Section titled “Correct”resp = make_response("ok")resp.set_cookie("session", token, httponly=True, secure=True, samesite="Lax")return respAlways set sensitive cookies with secure=True so they are sent only over HTTPS.