From patchwork Thu May 13 09:27:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 4265 Return-Path: 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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FgmXR3Ztbz44RY for ; Thu, 13 May 2021 09:27:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FgmXP3J4xzjl; Thu, 13 May 2021 09:27:33 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FgmXP2XXcz2yDF; Thu, 13 May 2021 09:27:33 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FgmXN1tzbz2xs0 for ; Thu, 13 May 2021 09:27:32 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4FgmX46KGnzjl for ; Thu, 13 May 2021 09:27:16 +0000 (UTC) Received: (qmail 15051 invoked from network); 13 May 2021 09:27:16 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 13 May 2021 09:27:16 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH] getrrdimage.cgi: Allow more non-word characters in the URL Date: Thu, 13 May 2021 11:27:04 +0200 Message-Id: <20210513092705.1043-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1620898037; a=rsa-sha256; cv=none; b=FomBeLy+Cs8AGp9aflnaAOFDI0Cij9erDF5hnR+6Ck9q+proB57r/dLHP+8NC8wVBYo2E4 hEbeD3y89Yk8zuxX9SwP5mD8SlwDnUSarSJyu8hysA3Ujeq1Mg5yafYwzxn94/0pvXPbPo BSp8D+ASQ4D5642AVsv0ksNe59W6nxxfhYmXaTWZa6plzPHSIHUBV9t3ab42jNTfoRoeMR hQ7aS5bGjNbfxinEUnIlH/YWK6/mBulKR/JJxz8EfJqxSsJTUiuqlM945OIt3h5CDzatxL GX9QSTHW63h52pkmGOLf+Hcb/aUyoq5BUOw0cRplYgMXAm1AqgdRDX5hrg4WcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1620898037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=eJvThPO82ADwZC0w1Tgt8Ql03q/441rGpy7/RF9YGqI=; b=w3xPYFSTMM+97gaCwPe1sBmbK3b2Mrb2m2Fgdl84A7G0zyowEQB94QEppdEP2KXEnETCQJ kkj4feCHfIAL3tvgwWG4TuuL31RjWrooXMhTordJvVZaZ8jEFp+Cs/TCG8acH5YG2iDnZY vnzwBs4w/Knl8dKyPqNsCa4wLRma22iScDPYtLLYaovknG2Lms9NMB8pkMnEH63Tbp9kUB iTvAcymzUMBIFQQaK1VPaDcFZbQXGDV36qQFo2Pj12wakP+/Kd5z+hOiqf/tpALMr6PTzT 7oCxIhMKxskdz/m9oAidLDYSQ5U2Cd4qsI90Yl92YJzwbVzDPKii4T9DThvwcA== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [1.45 / 11.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MX_INVALID(0.50)[]; FROM_HAS_DN(0.00)[]; SPF_REPUTATION_HAM(-0.75)[-0.74702679352016]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; BLOCKLISTDE_FAIL(0.00)[185.26.156.147:query timed out]; MID_CONTAINS_FROM(1.00)[]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-3.00)[99.99%] X-Rspamd-Queue-Id: 4FgmX46KGnzjl Authentication-Results: mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de; dmarc=none X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" As discussed in bug #12615 Signed-off-by: Leo-Andres Hofmann Reviewed-by: Adolf Belka Reviewed-by: Peter Müller --- html/cgi-bin/getrrdimage.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/getrrdimage.cgi b/html/cgi-bin/getrrdimage.cgi index 34ee4bf7a..c08247c57 100644 --- a/html/cgi-bin/getrrdimage.cgi +++ b/html/cgi-bin/getrrdimage.cgi @@ -50,7 +50,7 @@ my $graph = $query{'graph'}; my $range = lc $query{'range'}; # lower case # Check parameters -unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w-]+?$/) && ($range ~~ @Graphs::time_ranges)) { +unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~ @Graphs::time_ranges)) { # Send HTTP headers _start_png_output();