summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2016-05-05 10:17:14 +0200
committerczaks <marcin@6irc.net>2016-05-05 10:17:14 +0200
commitc4b98e94cee5cb6bf89aea8dc36253ce754c6dcd (patch)
tree915a9c399c2d740f65d610ca7b6c5d1227007c19 /post.php
parent77176faececfceceb4c35eb4bfa80a99ed76a677 (diff)
[SECURITY] harden for imagetragick (we aren`t hit by the bug, but we were passing uncommon filetypes, like JPEG2000, directly to imagemagick)
Diffstat (limited to 'post.php')
-rw-r--r--post.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/post.php b/post.php
index 5c755a3c..dc303785 100644
--- a/post.php
+++ b/post.php
@@ -639,6 +639,9 @@ if (isset($_POST['delete'])) {
if (!$size = @getimagesize($file['tmp_name'])) {
error($config['error']['invalidimg']);
}
+ if (!in_array($size[2], array(IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_BMP))) {
+ error($config['error']['invalidimg']);
+ }
if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) {
error($config['error']['maxsize']);
}