polr icon indicating copy to clipboard operation
polr copied to clipboard

Make the Advanced Analytics compatible with Cloudflare

Open Tchekda opened this issue 3 years ago • 2 comments

With the previous code, the Geoip service was using the Request IP. In most of the case that works well but if the website is behind CloudFlare, the IP will be the proxy one.

Now it determines user's real IP if behind cloudflare or not. Fixes #499 #491

Tell me if you think something needs to be ajusted.

Tchekda avatar Oct 20 '20 23:10 Tchekda

This needs to be a config option. If it can't be turned off, then Polr administrators who do not deploy Polr behind a reverse proxy are left vulnerable to forged X-Forwarded-For HTTP headers, or whatever similar mechanism this API call uses (there is no way to securely determine whether X-Forwarded-For is authentic or not without this being set administratively in the config file).

strugee avatar Dec 08 '20 09:12 strugee

This needs to be a config option. If it can't be turned off, then Polr administrators who do not deploy Polr behind a reverse proxy are left vulnerable to forged X-Forwarded-For HTTP headers, or whatever similar mechanism this API call uses (there is no way to securely determine whether X-Forwarded-For is authentic or not without this being set administratively in the config file).

Fair point, will think about that.

The project looks a bit dead, don't think I will make a new PR to add that

Tchekda avatar Dec 08 '20 10:12 Tchekda