From 05c8cad9d7614b81e3a6f9aa1f5fe6386290d0a1 Mon Sep 17 00:00:00 2001 From: gustavf Date: Mon, 14 Feb 2000 07:55:37 +0000 Subject: [PATCH] Minor bug that let the user get files from any directory on the server using ../../dir/dir as attachments fixed. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@212 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/smtp.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions/smtp.php b/functions/smtp.php index d6bf6993..58f9db79 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -24,6 +24,10 @@ global $attachments, $attachment_dir; while (list($localname, $remotename) = each($attachments)) { + // This is to make sure noone is giving a filename in another + // directory + $localname = ereg_replace ("\\/", "", $localname); + $fileinfo = fopen ($attachment_dir.$localname.".info", "r"); $filetype = fgets ($fileinfo, 8192); fclose ($fileinfo); -- 2.25.1