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

Crawler ACLs issue - X-forwarded-for #1505

Open
Nuranto opened this issue Aug 29, 2018 · 2 comments
Open

Crawler ACLs issue - X-forwarded-for #1505

Nuranto opened this issue Aug 29, 2018 · 2 comments

Comments

@Nuranto
Copy link

Nuranto commented Aug 29, 2018

Hello,

In VCL templates, client.ip should be replaced by std.ip(regsub(req.http.X-Forwarded-For, "^(^[^,]+),?.*$", "\1"), client.ip) when checking ACLs.
Else it could use 127.0.0.1 as IP instead of real-user IP and cause troubles in softwares.
Of course, this issue occurs only if you have a proxy on front of varnish (which is almost always the case, at least for dealing with https).

Example :
Before :

if (client.ip ~ crawler_acl ||

After :

if (std.ip(regsub(req.http.X-Forwarded-For, "^(^[^,]+),?.*$", "\1"), client.ip) ~ crawler_acl ||
@bmalynovytch
Copy link

To complete @Nuranto's point: when Varnish is behind a local reverse proxy, ACLs are checked against ::1 which is useless and leads to strange behaviors.

@Nuranto
Copy link
Author

Nuranto commented Aug 29, 2018

Already spotted here : #1390

@miguelbalparda miguelbalparda added old-invalid Issues created before 2018-01-01. Will close en mass on Feb 15. and removed old-invalid Issues created before 2018-01-01. Will close en mass on Feb 15. labels Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants