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 4cXYdC2WBrz2xph for ; Thu, 25 Sep 2025 12:56:47 +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) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4cXYd76r6kz2xM3 for ; Thu, 25 Sep 2025 12:56:43 +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 4cXYd70xgRz37w for ; Thu, 25 Sep 2025 12:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1758805003; 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=kJmURQkvLY/sWIYFH08bKum5mrNT4WwuYFNeVsGme6M=; b=kWBeJjqjaKLFNpScd9CTTz7wAa3O9cdvFj5E/on7iYn1ZP5YGXgzF+bsLRLHvdYioDPzv4 GnXwVxyx/JN5IVK+mGt00KoxeGfi81LMRUm3NMAcZXF4E3/ihu+0oKi6JbfHUtN0ytPhSx HpsRefKu+cEug2iERZ+KMR+kMLNqis0zOtcg6M6xA20jV3G9XxvY+gsprZvlgRpRrTzAa0 Y4m7Xn3+IV+yhYqNCEqbHY5XyrASPbYy0RWkgt9ZzJyf/qI2tlLxW92YX8Qpa2/kGoQSxP PSAt0i7FR1DKRPXj+XU42ZD4/1jO46c136Q4A+qZzNYrzyfRKjzO/aqiv54yBQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1758805003; 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=kJmURQkvLY/sWIYFH08bKum5mrNT4WwuYFNeVsGme6M=; b=qZdtXvq4UghaFWgWQYCLA6n7CoWrabLmGsf/338Qm/DhwvaI2VvzC8ugsxdcL5+ukp5b09 mrrInztoDjEQtVAA== Message-ID: <7a5756a6-f928-42d8-9ced-70f31c4e4fb0@ipfire.org> Date: Thu, 25 Sep 2025 14:56:41 +0200 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Subject: Re: [PATCH 03/16] ovpnclients.dat: Fixes bug 13879 To: development@lists.ipfire.org References: <20250925111252.11893-1-adolf.belka@ipfire.org> <20250925111252.11893-3-adolf.belka@ipfire.org> Content-Language: en-GB From: Bernhard Bitsch In-Reply-To: <20250925111252.11893-3-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 13879 - CONNECTION_NAME SQL Injection > Signed-off-by: Adolf Belka > --- > html/cgi-bin/logs.cgi/ovpnclients.dat | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat > index 8fbf4f8fa..5e6baef3c 100644 > --- a/html/cgi-bin/logs.cgi/ovpnclients.dat > +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat > @@ -2,7 +2,7 @@ > ############################################################################### > # # > # IPFire.org - A linux based firewall # > -# Copyright (C) 2020 IPFire Team # > +# Copyright (C) 2020 - 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 # > @@ -141,7 +141,7 @@ my $database_query = qq( > ORDER BY common_name, duration DESC; > ); > > -if ($cgiparams{'CONNECTION_NAME'}) { > +if (($cgiparams{'CONNECTION_NAME'}) && ($cgiparams{'CONNECTION_NAME'} =~ /^[a-zA-Z0-9]+$/)) { > $database_query = qq( > SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent, > STRFTIME('%s', DATETIME(disconnected_at)) - STRFTIME('%s', DATETIME(connected_at)) AS duration FROM sessions