From 47e9f8470ad5f8c134ad36e125bd7d6d78b61b7f Mon Sep 17 00:00:00 2001 From: Adolf Belka Date: Thu, 25 Sep 2025 13:12:37 +0200 Subject: [PATCH] fwhosts.cgi Fix for bug 13876 & bug 13877 Fixes: Bug 13876 savelocationgrp COUNTRY_CODE Stored Cross-Site Scripting Fixes: Bug 13877 saveservice PROT Stored Cross-Site Scripting Signed-off-by: Adolf Belka Reviewed-by: Bernhard Bitsch Signed-off-by: Michael Tremer --- html/cgi-bin/fwhosts.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 953f81e5f..a666969b0 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2013 Alexander Marx # +# Copyright (C) 2013-2025 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -714,7 +714,7 @@ if ($fwhostsettings{'ACTION'} eq 'savelocationgrp') } if ($fwhostsettings{'update'} eq 'on'){ - @target=$fwhostsettings{'COUNTRY_CODE'}; + @target=&Header::escape($fwhostsettings{'COUNTRY_CODE'}); $type='Location Group'; #check if host/net exists in grp @@ -796,7 +796,7 @@ if ($fwhostsettings{'ACTION'} eq 'saveservice') foreach my $i (0 .. 4) { $customservice{$key}[$i] = "";} $customservice{$key}[0] = $fwhostsettings{'SRV_NAME'}; $customservice{$key}[1] = $fwhostsettings{'SRV_PORT'}; - $customservice{$key}[2] = $fwhostsettings{'PROT'}; + $customservice{$key}[2] = &Header::escape($fwhostsettings{'PROT'}); $customservice{$key}[3] = $ICMP; &General::writehasharray("$configsrv", \%customservice ); #reset fields -- 2.47.3