FIX CVE-2019-11199

This commit is contained in:
Laurent Destailleur 2019-07-30 14:00:43 +02:00
parent 471a947e8a
commit 6aefa648e7

View File

@ -170,7 +170,9 @@ if (GETPOST('type','alpha')) $type=GETPOST('type','alpha');
else $type=dol_mimetype($original_file);
// Security: This wrapper is for images. We do not allow type/html
if (preg_match('/html/', $type)) accessforbidden('Error: Using the image wrapper to output a file with a mime type HTML is not possible.', 1, 1, 1);
if (preg_match('/html/i', $type)) accessforbidden('Error: Using the image wrapper to output a file with a mime type HTML is not possible.', 1, 1, 1);
// Security: This wrapper is for images. We do not allow files ending with .noexe
if (preg_match('/\.noexe$/i', $original_file)) accessforbidden('Error: Using the image wrapper to output a file ending with .noexe is not allowed.', 1, 1, 1);
// Security: Delete string ../ into $original_file
$original_file = str_replace("../","/", $original_file);