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

HTTP Referer #565

Closed
2 tasks done
Alkarex opened this issue Aug 4, 2014 · 26 comments
Closed
2 tasks done

HTTP Referer #565

Alkarex opened this issue Aug 4, 2014 · 26 comments

Comments

@Alkarex
Copy link
Member

Alkarex commented Aug 4, 2014

@Alkarex
Copy link
Member Author

Alkarex commented Aug 4, 2014

In Mozilla Firefox #564 (comment):

  • network.http.sendRefererHeader should be set to its default value (2) or value 1. A value of 0 will fail. (0=don't send any, 1=send only on clicks, 2=send on image requests as well)
    • First, it's not so important: sensitive sites are supposed to use HTTPS which is mostly immune less sensitive to the Referer problem; and most of the inter-domain tracking is done by cookies and/or shared images/scripts which work even when Referer is disabled (and also to some extent when third-party cookies are disabled).
    • If you still really are concerned about HTTP inter-domain tracking, consider instead network.http.referer.XOriginPolicy (0=always send, 1=send iff base domains match, 2=send iff hosts match) and/or network.http.referer.trimmingPolicy (0=full URI, 1=scheme+host+port+path, 2=scheme+host+port).
    • There are also some add-ons for this job.
  • Warning: using network.http.referer.spoofSource makes the browser vulnerable to XSRF attacks

@marienfressinaud
Copy link
Member

We should also add a note about Docker: exposed port must be the same as the one on which Apache listens in the Docker container.

For instance, my Apache (in a container so) listens on port 80 but exposed port was 8080. So there was a redirection and I wasn't able to change configuration.

@Alkarex
Copy link
Member Author

Alkarex commented Aug 8, 2014

I do not know if it was your case, but HTTPS Referer is typically not sent between different { domain, port } so you end up with an empty Referer, which could be a sign of an attack.
Otherwise, I currently do not check the port in the Referer, only the domain, so if all pages are served from the same { domain, port} in the case of HTTPS, or same domain in the case of HTTP, there should be no problem.

@marienfressinaud
Copy link
Member

It's just I asked a page on port 8080 but final request was on port 80 because the Docker redirection.

@Alkarex
Copy link
Member Author

Alkarex commented Aug 8, 2014

La conversation pour une meilleure méthode basée sur un token continue dans #570

@Alkarex
Copy link
Member Author

Alkarex commented Aug 8, 2014

Je copie un commentaire de @marienfressinaud #554 (comment)

il reste les actions comme "marquer comme lu" et "favoris". Si un id n'est pas forcément facile à deviner, il reste la question du bouton "tout marquer comme lu" qui peut être plus problématique pour certains.

@GLLM
Copy link

GLLM commented Aug 29, 2014

Just to let you know : since the last update I'm getting the HTTP_REFERER issue with a plain Android 4.4.3 (Galaxy S4) + default Chrome browser.

To access my FR, I use http://ip:port/path ... port being an exotic one.

I've been forced to deactivate the safe authentication, otherwise I cannot use it from my smartphone :(

A+
GLLM

@Alkarex
Copy link
Member Author

Alkarex commented Aug 29, 2014

@GLLM Is it at the form login that it fails?

@GLLM
Copy link

GLLM commented Aug 29, 2014

Yes, when trying to log in .. I never managed to get past the login screen.

@Alkarex
Copy link
Member Author

Alkarex commented Aug 29, 2014

Any chance that you could find out what value is sent in HTTP_REFERER in your case, for instance using a script with phpinfo (see below) with a link from another page?

<?php
phpinfo();

@GLLM
Copy link

GLLM commented Aug 29, 2014

If I create a standalone php page with the above code, open it on my smartphone, would it be ok ?

@GLLM
Copy link

GLLM commented Aug 30, 2014

Just did the test :
the value sent is : http://my.own.home.ip:port/

@Alkarex
Copy link
Member Author

Alkarex commented Aug 30, 2014

Could you please try to make a link from another page, like:

<a href="phpinfo.php">Link</a>

@GLLM
Copy link

GLLM commented Aug 30, 2014

Sorry @Alkarex I realized my mistake and just did the test : result above ;)

@Alkarex
Copy link
Member Author

Alkarex commented Aug 30, 2014

@GLLM : And what is the value of HTTP_HOST?

$_SERVER['HTTP_REFERER'];
$_SERVER['HTTP_HOST'];

@GLLM
Copy link

GLLM commented Aug 30, 2014

$_SERVER['HTTP_REFERER'] == http://my.own.home.ip:port/
$_SERVER['HTTP_HOST'] == my.own.home.ip:port

@Alkarex
Copy link
Member Author

Alkarex commented Aug 30, 2014

Ok, I see the problem. I will prepare a patch.

@GLLM
Copy link

GLLM commented Aug 30, 2014

U rock !
Merci
GLLM

Alkarex added a commit that referenced this issue Aug 30, 2014
Now tests also for the scheme and port, which must be identical to the
ones in the referer.

#565 (comment)
#554
@Alkarex
Copy link
Member Author

Alkarex commented Aug 30, 2014

@GLLM Please try the lastest /dev or with the patch a126d99

@GLLM
Copy link

GLLM commented Sep 2, 2014

Hello,

I manually edited the files ... works fine :)

Many thanks,
GLLM

@marienfressinaud
Copy link
Member

Test of HTTP REFERER for installation has been implemented in 75bf305 and fc7d2a0

@marienfressinaud marienfressinaud modified the milestones: 0.9.0, 0.8.0 Sep 26, 2014
@alemairebe
Copy link

Hello,
I've just had an error with the http referer ;
I'm using a proxy in front of my webserver which is doing ssl offloading.
resulting a bad http_referer.
according to the code the proto scheme is only check if _SERVER[HTTPS] is on, but it sould also check those 2 :
proxy_set_header X-Forwarded-Proto $scheme;
add_header Front-End-Https on;
Best regards,
Adrien

Alkarex added a commit that referenced this issue Nov 4, 2014
If needed, we may re-introduce the check for scheme with proper support
for proxy
#565 (comment)
@Alkarex
Copy link
Member Author

Alkarex commented Nov 4, 2014

@alemairebe I have removed the check for scheme in the referer, while waiting for a better solution. Furthermore, I am not sure of the added security value of checking the scheme. ba7d63e
If possible, I would better like to find a cleaner solution than checking non-standard headers such as Front-End-Https.

@alemairebe
Copy link

ok, thanks for reacting so quickly

@Alkarex
Copy link
Member Author

Alkarex commented Nov 4, 2014

@marienfressinaud We may have to introduce a constant to override the guessing of the public URL based on $_SERVER['HTTP_HOST'], for the case of a proxy changing the scheme, and/or the host, and/or the port. But let's wait if anybody asks for it.

@marienfressinaud marienfressinaud modified the milestones: 2.0.0, 0.10-dev, 1.0.0 Dec 9, 2014
@Alkarex Alkarex modified the milestones: 1.0.0, 2.0.0 May 16, 2015
@Alkarex Alkarex modified the milestones: 1.3.1-beta, 2.0.0 Feb 27, 2016
Alkarex added a commit that referenced this issue Feb 28, 2016
Add note about Referer #565
Add note about DOM / XML extensions
#1094
@Alkarex Alkarex closed this as completed Feb 28, 2016
@Alkarex Alkarex self-assigned this Feb 28, 2016
@Alkarex
Copy link
Member Author

Alkarex commented Aug 13, 2016

<meta name="referrer" content="never" /> is now implemented natively in FreshRSS for anonymising outgoing links #1210 and HTTP Referer checks are now accepting an empty string
Tests welcome of the /dev branch

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

No branches or pull requests

4 participants