]> git.proxmox.com Git - pve-apiclient.git/commitdiff
lwp: set SameSite attr of auth cookie to 'strict'
authorMax Carrara <m.carrara@proxmox.com>
Wed, 15 Mar 2023 16:26:30 +0000 (17:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Jun 2023 15:15:56 +0000 (17:15 +0200)
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>
src/PVE/APIClient/LWP.pm

index ed7e4feecbc1133af06e9202e8dcb5cddd1d7a53..722b35ad9911881b803d46244962de14cf876158 100755 (executable)
@@ -89,7 +89,7 @@ sub update_ticket {
     $self->{ticket} = $ticket;
 
     my $encticket = uri_escape($ticket);
-    my $cookie = "$self->{cookie_name}=$encticket; path=/; secure;";
+    my $cookie = "$self->{cookie_name}=$encticket; path=/; secure; SameSite=Strict;";
     $agent->default_header('Cookie', $cookie);
 }