From d06b0ef16f08c663acaa9725206650893fc1cd74 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sat, 15 May 2021 22:10:47 +0200 Subject: [PATCH] pakfire.cgi: Check user given package list for invalid characters. Check the user given list of packages which should be installed or removed for any unallowed characters. Otherwise the list could contain manipulated elements, which will be passed to the shell which calls the pakfire instance. This allows an attacker which is authenticated to the WUI to perform RCE. Fixes #12616. Signed-off-by: Stefan Schantl --- html/cgi-bin/pakfire.cgi | 45 +++++++++++++++++++++++++++++++++------- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index a9e12d23c1..4dad5b2c11 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -54,12 +54,19 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, " 'Wählen Sie ein oder mehrere Pakete zur Installation aus und drücken Sie auf das plus-Symbol.', 'pakfire install package' => 'Sie möchten folgende Pakete installieren: ', 'pakfire installed addons' => 'Installierte Addons:', +'pakfire invalid characters in package list' => 'Die Paketliste beinhaltet ungültige Zeichen', 'pakfire invalid tree' => '', 'pakfire last core list update' => 'Letztes Corelisten Update ist', 'pakfire last package update' => 'Letztes Paketlisten Update ist', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index dc1fd8d67b..23a954a6f9 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -2005,6 +2005,7 @@ 'pakfire install description' => 'Please choose one or more items from the list below and click the plus to install.', 'pakfire install package' => 'You want to install the following packages: ', 'pakfire installed addons' => 'Installed Addons:', +'pakfire invalid characters in package list' => 'The package list contains invalid characters', 'pakfire invalid tree' => 'Invalid repository selected', 'pakfire last core list update' => 'Last core list update made', 'pakfire last package update' => 'Last packages list update made', -- 2.39.2