Issue with Image Proxy and Imgur.com

Started by tjbalon, June 15, 2017, 06:15:15 PM

Previous topic - Next topic

tjbalon

Not sure if this is reported yet however one of the major image sites, imgur doesn't seem to be working with the image proxy currently.

Example:
https://tangoworldwide.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FJC0yC6o.png&hash=63a432f67bd39c8aa12c3865d25df0c3

This is a proxy pass via our website which is breaking the image, however that image: https://i.imgur.com/JC0yC6o.png surely exists.

Illori



are you sure it is not working? it seems to be working in the above image.

Shambles

The request is being passed to the proxy code as http not https, which is why imgur is rejecting it.

Changing the request code to include the missing "s" causes it to function correctly.

https://tangoworldwide.net/proxy.php?request=https%3A%2F%2Fi.imgur.com%2FJC0yC6o.png&hash=63a432f67bd39c8aa12c3865d25df0c3

Something in 2.0.14 is changing it along the way.


Gluz

If the image is https then it doesn't need to use the proxy at all.


tjbalon

Quote from: Gluz on June 16, 2017, 04:46:38 PM
If the image is https then it doesn't need to use the proxy at all.

Also this is not true, you can still use things such as:
https://zacharydubois.me/sig.php

Leaking user IPs is possible if you are not filtering all images.

tjbalon

#7
Sorry for a triple post, not letting me modify... Anyhow,

1. Implementing a change to Subs for just imgur.com works, but hard coding is very sloppy.

2. The issue remains at this time, and I'm not sure why. Is this only because of how imgur does it's links?

3. Is there any other fix for this as of now, or can someone take a second look (hopefully Sleepy).

4. It is happening in avatars too, so if I implement the change in Subs that does not fix everything.

Here's a better example:
Link: http//i.imgur.com/5zMGjbH.png
Proxy: https://tangoworldwide.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F5zMGjbH.png&hash=ac115fe07253dd3b7153f53ddadf0134

If I build the link off the proxy by                                     ^ here                     ^ here                 ^ here
I get back: http//i.imgur.com/5zMGjbH.png

Which will load without the proxy?

Gluz

Quote from: balonfx on June 17, 2017, 05:16:00 PM
Quote from: Gluz on June 16, 2017, 04:46:38 PM
If the image is https then it doesn't need to use the proxy at all.

Also this is not true, you can still use things such as:
https://zacharydubois.me/sig.php

Leaking user IPs is possible if you are not filtering all images.

I mean, the mere use of the proxy for a secure (https) site is that for any image that is not https the browser will mark the site as insecure by mixed content, so the proxy act as an intermediary to load the image from an https source. If the image is https in first place, it doesn't need to use the proxy, and if it's using it it's because something is wrong.

And that PHP script that generates an image is a pretty basic whatsmyip, it just shows your own public IP address and nothing more, and even if it's collecting all the IP's from where it's loaded, it can't use them for anything because it have no other information. And it's from an https source, so it shouldn't go through the proxy.

In your last example, the image on imgur doesn't even load, it says that the page isn't redirecting properly. So, it should be a redirection problem, as stated in this post and the fix in here should work if the url is from a valid image.

tjbalon

Apologies Gluz,

http://i.imgur.com/5zMGjbH.png

Is the correct link, forgot the :

This is a new bug by the way, randomly appeared a few days ago with no code edits.

Gluz

What I've seen is that some times large images doesn't load right away, the proxy caching take some time, more than it should be (I think), and for imgur, it displays the image that says that not exists or is no longer available, but I tested in my forum and it does load that image, http with the proxy and https without the proxy, so, I don't know how it's reproducible on some forums and not in others.

tjbalon

#11
I might do a sloppy fix to replace http to https if it is imgur.

But wish I could do it another way if anyone can help out here. Not sure what's causing it JUST with imgur but I have bug reports like crazy from our members.

I'll also need to find out where this works in the avatars displaying as well to pass through image proxy.
--
Originally, I shut caching entirely but now I've lifted it up to 8192kb but it's the same issue.

Gluz

Yeah, a fix to change all the imgur to https automatically is the best bet IMO, like with the censored words, so every time a user post a image http from imgur, it will automatically replace it with the https and then no need to use the proxy at all.

For the avatars, I personally don't like the external URL, I rather give them the option to upload the image to the forum, or make it so the forum download the image from the URL, that way it doesn't rely on external sites every time.

Arantor

Guess you've never had takedown notices over copyrighted images being used as avatars ;)

Gluz

Not for copyrighted​ images, just for a couple of links of video material licenced in Spain, that we take down even that we are from various parts of Latin America and it's not available in any way, shape or form here, and that's the most common takedown notices in the kind of forums I run, for the videos linked, as it could be considered an illegal download.

tjbalon

Quote from: Arantor on June 19, 2017, 01:30:53 AM
Guess you've never had takedown notices over copyrighted images being used as avatars ;)

Arantor do you have any clue what would cause this issue with imgur on our website? You've helped me numerous other times haha hoping someone says something that I'm missing here. I still don't understand what specifically is messing up, unless it's 100% on the Imgur side of re-direction.

@rjen

I just posted your image link into my test forum and it works without problems.

Did you try this fix?  https://www.simplemachines.org/community/index.php?topic=553901.msg3926548#msg3926548

That resolved my problems with proxy images not showing...

Quote from: SleePy on May 17, 2017, 09:04:23 PM
Open $sourcedir/Class-CurlFetchWeb.php

Find:

$this->headers[strtolower($temp[0])] = strtolower(trim($temp[1]));


Replace:

$this->headers[strtolower($temp[0])] = trim($temp[1]);


Note, that this code may end up being the patched code in the next release.  If so, you would need to revert it prior to applying the next release.
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

tjbalon

Yes rjen, I tried this and it still did not work.

Advertisement: