From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4cXWKq1LJLz338w for ; Thu, 25 Sep 2025 11:13:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4cXWKl5B3xz2xQT for ; Thu, 25 Sep 2025 11:13:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4cXWKk2vXKzHW; Thu, 25 Sep 2025 11:13:14 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1758798794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=K7lAGHuw5HQg5BHGdMkRpMJZ0y33+Eq1n7EnDIvc8WU=; b=tVN3PM18ToY/MDCnpQiU9Cp/qNZ3IEe5vOGsBWU9tAkYL0RqjvHuHdaetw9HE9h2bFGklT ua/kiMigTEzLmrAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1758798794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=K7lAGHuw5HQg5BHGdMkRpMJZ0y33+Eq1n7EnDIvc8WU=; b=Mtn9beySxqirU6CEbrdvKdOg3WaB1WZDGtBy+w3k7/lClDhMrFom11q3G+F8QECAsOerf0 nxXsRv8xcn5FG8702BBZLZiS0bw76x+ho+VUInCA2pIH99R+OiQTSn6Fw7tKrkMdonBhbW sW5A3q7eA4FZRQ6zM9iabzpa0SoscYylwtJxeqpBbhMG1v26RBnkvi/M7nKBKoKmJwoEBB KLZP3x5lsSQYz5EAUm4uBaKd4PhCouX8ZwsvGR/68skSwQhx5zqyG/dtOMU1z7VhM3x665 cWWxdrbGOg1Qhhwq3BsRX7rQda6qdOE7yiWw0ve4pfPVZfZ+KOvFqJX+msG5Ew== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH 01/16] fwhosts.cgi Fix for bug 13876 & bug 13877 Date: Thu, 25 Sep 2025 13:12:37 +0200 Message-ID: <20250925111252.11893-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fixes: Bug 13876 savelocationgrp COUNTRY_CODE Stored Cross-Site Scripting Fixes: Bug 13877 saveservice PROT Stored Cross-Site Scripting Signed-off-by: Adolf Belka --- 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.51.0