forked from leftypol/leftypol
Block files exploiting IE's mime-sniffing 'feature'
This commit is contained in:
parent
406d287cd1
commit
c544ad9bb8
2 changed files with 11 additions and 0 deletions
7
post.php
7
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']);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue