From: Michael Tremer Date: Mon, 24 Oct 2022 14:57:56 +0000 (+0100) Subject: clwarn.cgi: Remove XSS X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0edf1e8e879715eabd8b18d0798893d63a5baffe;p=people%2Fms%2Fipfire-2.x.git clwarn.cgi: Remove XSS Fixes: #12966 Reported-by: Arthur Naullet Reported-by: Rafael Lima Signed-off-by: Michael Tremer --- diff --git a/html/html/clwarn.cgi b/html/html/clwarn.cgi index 44f7f98abc..c7a415cdb8 100644 --- a/html/html/clwarn.cgi +++ b/html/html/clwarn.cgi @@ -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