Parcourir la source

Security fix in ext.php (#4928)

Details later.
Due to https://github.com/FreshRSS/FreshRSS/pull/3433 (1.18.0)
Alexandre Alapetite il y a 3 ans
Parent
commit
62afc060a8
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      p/ext.php

+ 2 - 1
p/ext.php

@@ -101,7 +101,8 @@ if (!isset($_GET['f']) ||
 
 
 $file_name = urldecode($_GET['f']);
 $file_name = urldecode($_GET['f']);
 $file_type = $_GET['t'];
 $file_type = $_GET['t'];
-if (empty(SUPPORTED_TYPES[$file_type])) {
+if (empty(SUPPORTED_TYPES[$file_type]) ||
+	empty(SUPPORTED_TYPES[pathinfo($file_name, PATHINFO_EXTENSION)])) {
 	sendBadRequestResponse('File type is not supported.');
 	sendBadRequestResponse('File type is not supported.');
 }
 }