]> git.ipfire.org Git - people/mlorenz/ipfire-2.x.git/commitdiff
clwarn.cgi: Remove XSS
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Oct 2022 14:57:56 +0000 (15:57 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 24 May 2023 08:22:14 +0000 (08:22 +0000)
Fixes: #12966
Fixes: CVE-2022-44392
Reported-by: Arthur Naullet <arthur.naullet@epita.fr>
Reported-by: Rafael Lima <isec-researcher@protonmail.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/html/clwarn.cgi

index 44f7f98abc396cb2819ef1e2087bdb67ee48b700..c7a415cdb81341ffcd9e91e21621750969c85bef 100644 (file)
@@ -20,6 +20,7 @@
 ###############################################################################
 
 use CGI qw(param);
+use HTML::Entities();
 
 # enable only the following on debugging purpose
 use warnings;
@@ -30,11 +31,11 @@ $swroot="/var/ipfire";
 
 my $TITLE_VIRUS = "SquidClamAv Virus detection";
 
-my $url = param('url') || '';
-my $virus = param('virus') || '';
-my $source = param('source') || '';
+my $url = &HTML::Entities::encode_entities(param('url') || '');
+my $virus = &HTML::Entities::encode_entities(param('virus') || '');
+my $source = &HTML::Entities::encode_entities(param('source') || '');
 $source =~ s/\/-//;
-my $user = param('user') || '';
+my $user = &HTML::Entities::encode_entities(param('user') || '');
 
 
 # Remove clamd infos