Zum Inhalt springen

Cookie missing HttpOnly (ARCH2124)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key python.security.cookie-missing-httponly · Severity warning · Category security · CWE CWE-1004

Session or auth cookies without the HttpOnly flag are readable by JavaScript. When an XSS flaw exists, these cookies can be stolen and the session hijacked.

resp = make_response("ok")
resp.set_cookie("session", token, secure=True, httponly=False)
return resp
resp = make_response("ok")
resp.set_cookie("session", token, secure=True, httponly=True, samesite="Lax")
return resp

Always set session and auth cookies with httponly=True.