Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Does HTTPS Everywhere allow rules that redirect to a different domain? #4273

Closed

Description

@VanguardLH

I ran into a problem visiting http://www.virusbtn.com/. That site switched to a new domain, which is https://www.virusbulletin.com/. The first uses HTTP which uses a Location header to point their HTTPS domain. So visiting their HTTP site attempts to redirect the visitor to their new but different domained HTTPS site.

I looked in the rules in HTTPS Everywhere regarding the virusbtn.com site. All they do is change the http:// protocol to https:// but the virusbtn.com remains the same. I realize that it is considered a no-no to redirect to a different domain since that can be used as a covert tactic to get the visitor to a different site than they specified and the visitor may not notice the URL change in the address bar of their web browser. However, I also know that sites will sometimes use a new domain to build a new version of their site. When they are ready to go public with their new web site, they put the Location header in their old site's home page to push visitors to their new site.

Switching from HTTP to HTTPS can sometimes break a site, especially if the site does it which opens a window of vulnerability between the HTTP and HTTPS connects. Redirecting to a different domain can trigger an alert (by an aware user) that they may not be where they thought they would go. So I am wondering if HTTPS Everywhere allows its rules to not only change the protocol (from HTTP to HTTPS) but to also change to a different domain for, in this case, a new site to replace the old one and the new site implements HTTPS.

If redirecting to a different domain while changing the protocol is permitted in the rules then the rule for virusbtn.com is out of date. It should redirect http://www.virusbtn.com/ to https://www.virusbulletin.com.

Activity

  1. fuglede commented on Mar 6, 2016

    @fuglede
    Contributor

    Answering the question first of all: Not only is that allowed, it's actually pretty common. The most common use-case is for either adding or removing the "www" part of a hostname for a poorly configured domain. Another common one is for redirecting CDN buckets to their generic hostnames in which case certificates often do not cover the hosts the CDN delivers content to.

    In both of those cases, it comes with a bit of a downside though, though, as it may break the site it attempts to fix the instant the site manager fixes their site themselves, so it is often better to not "help" the site too much, if it can be avoided.

    One example could be the rule

    <rule from="^http://cms\.kiva\.org\.s3\.amazonaws\.com/"
            to="https://s3-us-west-1.amazonaws.com/cms.kiva.org/" />
    

    In your specific case, we actually have to update the ruleset, since it looks like the https://www.virusbtn.com is misconfigured and could cause breakage:

    $ curl https://virusbtn.com
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    $ curl https://www.virusbtn.com
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    
  2. funkydude commented on Mar 6, 2016

    @funkydude
    Contributor

    I'm personally doing exactly this in one of my pull requests to get past ISP censorship which would block the server from automatically forwarding the user to the new domain.

    However, that's unlikely to ever apply to this website, which automatically forwards the user to virusbulletin.com perfectly fine.

    There is one problem that might arise. The cert for virusbtn.com expires in may, and they may decide not to bother renewing it. In this case, the rule would need updated to manually forward users to virusbulletin.com

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions