Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to block https://wsrv.nl ? #401

Closed
paul-uz opened this issue Dec 18, 2023 · 5 comments
Closed

How to block https://wsrv.nl ? #401

paul-uz opened this issue Dec 18, 2023 · 5 comments

Comments

@paul-uz
Copy link

paul-uz commented Dec 18, 2023

We would like to entirely block the usage of https://wsrv.nl/ linking our images on other sites.

We have implemented an IP block already, but some images have already been cached; how can we get the cached images removed?

Also, I noticed the query param errorredirect - how can we effectively stop that from being useful? We've blocked wsrv.nl, and would want to stop the redirect happening as well.

@andrieslouw
Copy link
Member

It's hard to stop the errorredirect, as it seems to be working as intented. Please let us know why exactly we'd need to block, and we'll look into it. Normally our service would prevent your servers from getting too many requests.

@paul-uz
Copy link
Author

paul-uz commented Dec 18, 2023

We want to try and block initial attempts at hotlinking images as they are the IP of our clients. Various Chinese sites are using your service to hotlink the images. By blocking your service initially, a cached copy of the image can never be created.

@kleisauke
Copy link
Member

kleisauke commented Dec 19, 2023

Hotlink protection (based on the HTTP referer header) can be easily bypassed these days with a referrerpolicy of no-referrer, which can be set on the HTML document with:

<meta name="referrer" content="no-referrer" />

Or on specific images with:

<img src="https://example.com/images/myimage.jpg" referrerpolicy="no-referrer">

Therefore, there are no plans to make the &default= / &errorredirect= query strings opt-out for some URLs.

@kleisauke
Copy link
Member

Note that nowadays you could set the Cross-Origin-Resource-Policy: same-origin (CORP) header on the images you serve for enhanced hotlink protection, which is also effective even when referrerpolicy is used, see:
https://exact.realty/blog/posts/2022/10/09/hotlink-protection-in-2022/

I assumed that using the &default= / &errorredirect= query strings implies referrerpolicy="no-referrer", but this isn't the case. It looks like the original referrer is still retained.

We have implemented an IP block already, but some images have already been cached; how can we get the cached images removed?

If you want, you can send us an email with the images that are affected and need to be purged from cache.

@kleisauke
Copy link
Member

I hope this information helped. Please feel free to re-open if questions remain.

how can we get the cached images removed?

Let's track this at #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants