CVE-2022-4867 (published 2022-12-31T09:15Z)

Cross-Site Request Forgery (CSRF) in GitHub repository froxlor/froxlor prior to 2.0.0-beta1.

CVSS v3 base score: 4.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N)

Weakness information:
cwe_id: CWE-352
cwe_name: Cross-Site Request Forgery (CSRF)
description: The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
extended_description: When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
         

Fix information:
repo_url: https://github.com/froxlor/froxlor
commit_details: repo_url: https://github.com/froxlor/froxlor
author: Michael Kaufmann
author_date: 2022-12-31 09:08:34+01:00
msg: fix csrf for clearing apcu/opcache cache

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
repository: repo_url: https://github.com/froxlor/froxlor
repo_name: froxlor/Froxlor
description: The server administration software for your needs - The official Froxlor development Git repository
repo_language: PHP
owner: froxlor
file_changes: filename: admin_apcuinfo.php
change_type: ModificationType.MODIFY
diff: @@ -34,6 +34,7 @@
 use Froxlor\FroxlorLogger;
 use Froxlor\UI\Panel\UI;
 use Froxlor\UI\Response;
+use Froxlor\UI\HTML;
 
 const AREA = 'admin';
 require __DIR__ . '/lib/init.php';
@@ -41,13 +42,23 @@ require __DIR__ . '/lib/init.php';
 $horizontal_bar_size = 950; // 1280px window width
 
 if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
-	apcu_clear_cache();
-	$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
-	header('Location: ' . $linker->getLink([
+	if ($_POST['send'] == 'send') {
+		apcu_clear_cache();
+		$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
+		header('Location: ' . $linker->getLink([
+				'section' => 'apcuinfo',
+				'page' => 'showinfo'
+			]));
+		exit();
+	} else {
+		HTML::askYesNo('cache_reallydelete', $filename, [
+			'page' => $page,
+			'action' => 'delete',
+		], '', [
 			'section' => 'apcuinfo',
 			'page' => 'showinfo'
-		]));
-	exit();
+		]);
+	}
 }
 
 if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) {

programming_language: PHP
filename: admin_opcacheinfo.php
change_type: ModificationType.MODIFY
diff: @@ -35,15 +35,26 @@ require __DIR__ . '/lib/init.php';
 use Froxlor\FroxlorLogger;
 use Froxlor\UI\Panel\UI;
 use Froxlor\UI\Response;
+use Froxlor\UI\HTML;
 
 if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
-	opcache_reset();
-	$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
-	header('Location: ' . $linker->getLink([
+	if ($_POST['send'] == 'send') {
+		opcache_reset();
+		$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
+		header('Location: ' . $linker->getLink([
+				'section' => 'opcacheinfo',
+				'page' => 'showinfo'
+			]));
+		exit();
+	} else {
+		HTML::askYesNo('cache_reallydelete', $filename, [
+			'page' => $page,
+			'action' => 'reset',
+		], '', [
 			'section' => 'opcacheinfo',
 			'page' => 'showinfo'
-		]));
-	exit();
+		]);
+	}
 }
 
 if (!function_exists('opcache_get_configuration')) {

programming_language: PHP
filename: de.lng.php
change_type: ModificationType.MODIFY
diff: @@ -1279,6 +1279,7 @@ Vielen Dank, Ihr Administrator',
 		'apikey_reallyadd' => 'Einen neuen Api-Key erstellen?',
 		'dnsentry_reallydelete' => 'Wollen Sie den DNS-Eintrag wirklich löschen?',
 		'certificate_reallydelete' => 'Wollen Sie diese Zertifikat wirklich löschen?',
+		'cache_reallydelete' => 'Wollen Sie den Cache wirklich leeren?',
 	],
 	'serversettings' => [
 		'session_timeout' => [

programming_language: PHP
filename: en.lng.php
change_type: ModificationType.MODIFY
diff: @@ -1391,6 +1391,7 @@ Yours sincerely, your administrator',
 		'apikey_reallyadd' => 'Do you really want to create a new api-key?',
 		'dnsentry_reallydelete' => 'Do you really want to delete this zone entry?',
 		'certificate_reallydelete' => 'Do you really want to delete this certificate?',
+		'cache_reallydelete' => 'Do you really want to clear the cache?',
 	],
 	'redirect_desc' => [
 		'rc_default' => 'default',

programming_language: PHP