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 4cXYQq3H3jz2xph for ; Thu, 25 Sep 2025 12:47:47 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (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 4cXYQm0LVjz2xM3 for ; Thu, 25 Sep 2025 12:47:44 +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 4cXYQk0H4yz2RM for ; Thu, 25 Sep 2025 12:47:41 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1758804462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cc6R6MdXnvz4AARrEXOq+C2/nLj7LP57xP87WeaoGbc=; b=58nWg4ogIOe5IzKfdDCmsoDjZL/JG3owlupzpZviZgp4kqIQzacjTCAMiP9jEVGcG9WOdI TIEFeyle95o5YPAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1758804462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cc6R6MdXnvz4AARrEXOq+C2/nLj7LP57xP87WeaoGbc=; b=YO0SURBuDZyZZQ76bezEF6mwUCeh5eZ8DkR/JgXQF1BjPgy3i3qxqdbfcymoZ/gSLDxzJn zlZhIPuC7yqBDbHtQLP1+6VwSYDfAcyFgvaAHjtkP674Ets+tzx5+vNcSd0tfpwISw0WeE 9/GrGmI8hLdfTp/OItNYIOaXeFc9+IIQ751RTVIyV95Lt8r4jg/MSg1zlDJ+CQZeruXe1s dKB0bV+8V1MYtw1+fT32lCL4lcQ2JAuU1p6I0v7Q3/i6Ln/OnmoFvVnEizx4PsDOw8vlhp JbU+88kF2oO+ZAkN1WhVDFLBIb10BMGpJgnn7FcUNntcS1DliJle/GMFpoRBEg== Message-ID: <4ea20b34-aac5-4e4e-9b14-a38002b6f090@ipfire.org> Date: Thu, 25 Sep 2025 14:47:40 +0200 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Subject: Re: [PATCH 01/16] fwhosts.cgi Fix for bug 13876 & bug 13877 To: development@lists.ipfire.org References: <20250925111252.11893-1-adolf.belka@ipfire.org> Content-Language: en-GB From: Bernhard Bitsch In-Reply-To: <20250925111252.11893-1-adolf.belka@ipfire.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Bernhard Bitsch Am 25.09.2025 um 13:12 schrieb Adolf Belka: > 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