From c544ad9bb8c034eee1213991aac1cd2213a05d10 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sun, 10 Apr 2011 22:31:08 +1000 Subject: Block files exploiting IE's mime-sniffing 'feature' --- post.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'post.php') diff --git a/post.php b/post.php index 6e971ff1..53e0447b 100644 --- a/post.php +++ b/post.php @@ -407,6 +407,13 @@ error($config['error']['maxsize']); } + // Check IE MIME type detection XSS exploit + $buffer = file_get_contents($post['file'], null, null, null, 255); + if(preg_match($config['ie_mime_type_detection'], $buffer)) { + undoImage($post); + error($config['error']['mime_exploit']); + } + $post['filehash'] = $config['file_hash']($post['file']); $post['filesize'] = filesize($post['file']); -- cgit v1.3