mirror of
https://github.com/webmin/webmin.git
synced 2026-10-20 11:10:40 +01:00
Fix server login and logout cookie validation to be numeric
This commit is contained in:
@@ -11,6 +11,7 @@ our (%in);
|
||||
&ReadParse();
|
||||
my $enc = &encode_base64($in{'user'}.":".$in{'pass'});
|
||||
$in{'id'} =~ s/\r|\n|\0//g;
|
||||
$in{'id'} =~ /\A[0-9]+\z/ || &error("Invalid server ID");
|
||||
$enc =~ s/\r|\n|\0//g;
|
||||
print "Set-Cookie: $in{'id'}=$enc; path=/";
|
||||
if (uc($ENV{'HTTPS'}) eq 'ON') {
|
||||
|
||||
@@ -10,6 +10,7 @@ require './servers-lib.pl';
|
||||
&ReadParse();
|
||||
our (%in);
|
||||
$in{'id'} =~ s/\r|\n|\0//g;
|
||||
$in{'id'} =~ /\A[0-9]+\z/ || &error("Invalid server ID");
|
||||
print "Set-Cookie: $in{'id'}=; path=/";
|
||||
if (uc($ENV{'HTTPS'}) eq 'ON') {
|
||||
print "; secure";
|
||||
|
||||
Reference in New Issue
Block a user