Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: datex on September 26, 2014, 02:42:35 PM

Title: Upload of image fails
Post by: datex on September 26, 2014, 02:42:35 PM
Hi

I'm using SMF 2.0.8 - When I try to upload a certain image - it fails the security check. But I cannot figure out why. I have tried to remove EXIF from the image - but it didn't help. Any idea what might be wrong?
Title: Re: Upload of image fails
Post by: Night09 on September 26, 2014, 04:01:05 PM
It could be your hosts security mod set too high. You may have to ask them to check it out.
Title: Re: Upload of image fails
Post by: kat on September 26, 2014, 04:37:27 PM
How about attaching the image, here?
Title: Re: Upload of image fails
Post by: datex on September 26, 2014, 11:46:32 PM
You can find the image here: https://files.secureserver.net/0sL5S8YV3JDcaw
Title: Re: Upload of image fails
Post by: Antechinus on September 26, 2014, 11:53:06 PM
It's a 5 meg image, which is huge. How high are your attachment limits set?
Title: Re: Upload of image fails
Post by: datex on September 27, 2014, 01:29:15 AM
Hi

In SMF it is set to 0 (for unlimited). I tried to scale it in GIMP - and when export it (size 1.44 MB) - it still fails (of course GIMP can now have made some changes that make it to fail :-S ).
Title: Re: Upload of image fails
Post by: kat on September 27, 2014, 05:05:19 AM
Too big to attach, here. You could always make sure that "Perform extensive security checks on uploaded image attachments", in Attachment Settings", isn't checked. After all, the note does say "The extensive security checks can result in a large number of rejected attachments."

But, attaching images that are that big will mean that the space, on the server, is gonna be used-up pretty quickly.
Title: Re: Upload of image fails
Post by: Kindred on September 27, 2014, 07:49:38 AM
And also... Attachment size, in smf admin is only one spot to set...   There is a Max upload size setting in the SERVER configuration as well...
Title: Re: Upload of image fails
Post by: datex on September 27, 2014, 12:33:16 PM
Hi

I have checked:

Perform extensive security checks is turned OFF
The PHP configuration says: upload_max_filesize   200M
I have managed to upload file at size 5207KB without any problems.
Title: Re: Upload of image fails
Post by: Arantor on September 27, 2014, 12:41:52 PM
What *exactly* happens when it fails? Do you get an error, if so what does it say exactly?
Title: Re: Upload of image fails
Post by: datex on September 27, 2014, 12:48:39 PM
I get this error message: (Is it possible to see a more thorough error message)

Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.
Title: Re: Upload of image fails
Post by: Arantor on September 27, 2014, 12:55:18 PM
In which case I'm assuming it's the long standing bug where Photoshop leaves in its own proprietary nonsense, <cellTextIsHtml> which falls foul of the test for malice, even the less paranoid check.

To adjust this, Subs-Graphics.php:
// Check for potential infection
if (preg_match('~(iframe|html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk) === 1)
{
fclose($fp);
return false;
}


Replace with:
// Check for potential infection
if (preg_match('~(iframe|(?<!cellTextIs)html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk) === 1)
{
fclose($fp);
return false;
}


This is already in 2.1, but I'd encourage this be changed in future 2.0 releases.
Title: Re: Upload of image fails
Post by: datex on September 27, 2014, 01:05:33 PM
Strange - still the same error
Title: Re: Upload of image fails
Post by: datex on September 29, 2014, 11:30:56 PM
No idea - what might be wrong?

Is there a way to enable more logging?
Title: Re: Upload of image fails
Post by: Arantor on September 29, 2014, 11:32:08 PM
Any chance you could upload it somewhere for us to look at?
Title: Re: Upload of image fails
Post by: datex on September 29, 2014, 11:43:53 PM
The image - you can  download it here: https://files.secureserver.net/0sL5S8YV3JDcaw

Title: Re: Upload of image fails
Post by: kat on September 30, 2014, 06:29:15 AM
Attaching, here, just to see if it'll work, even though it's insanely HUGE!

(I suspect it'll get rejected, as it's so big).

Edit: Yeah, it's WAY too bog, for here. I think the sheer size of the thing's your problem. What if you shrink it? I've made it 1024x768 and attached it, to this.
Title: Re: Upload of image fails
Post by: datex on September 30, 2014, 11:08:12 AM
It might be some of the problem. I have the same error with another image (size 4.69 MB) - however I was able to upload an image with the size of (5.08 MB). The 2 images I have mentioned are not upright - might that be some of the problem - combined with the size?
Title: Re: Upload of image fails
Post by: Arantor on September 30, 2014, 11:11:52 AM
It should not be related to size or rotation, but there is something in the file that's throwing it off. Just haven't found what yet.
Title: Re: Upload of image fails
Post by: Night09 on October 01, 2014, 08:44:21 AM
If you download the image then a bit of a longshot but the properties of the image contain a fair bit of information.

(Im on win 7 here)  If you look under details at the bottom theres the option to remove properties and personal information. It may be something contained in that causing the security to reject the image. Same with the new one you mention if its the same source.