소스 검색

Minor bug that let the user get files from any directory on the server using
../../dir/dir as attachments fixed.

gustavf 25 년 전
부모
커밋
a92d01f2e1
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      functions/smtp.php

+ 4 - 0
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);