mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-04-30 21:00:17 +00:00
formatter/bootstrap: set SameSite attr of auth cookie to 'strict'
This prohibits the cookie from being sent along in cross-site sub-requests or when the user navigates to a different site. Signed-off-by: Max Carrara <m.carrara@proxmox.com>
This commit is contained in:
parent
1e9befeb80
commit
ded13125c2
@ -92,7 +92,7 @@ sub create_auth_cookie {
|
||||
|
||||
my $encticket = uri_escape($ticket);
|
||||
|
||||
return "${cookie_name}=$encticket; path=/; secure;";
|
||||
return "${cookie_name}=$encticket; path=/; secure; SameSite=Strict;";
|
||||
}
|
||||
|
||||
sub create_auth_header {
|
||||
|
@ -88,7 +88,7 @@ sub body {
|
||||
$jssetup .= "PVE.delete_auth_cookie = function() {\n";
|
||||
|
||||
if ($self->{cookie_name}) {
|
||||
$jssetup .= " document.cookie = \"$self->{cookie_name}=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; secure;\";\n";
|
||||
$jssetup .= " document.cookie = \"$self->{cookie_name}=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; secure; SameSite=Strict;\";\n";
|
||||
};
|
||||
$jssetup .= "};\n";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user