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.

Domain redirects should be verified #2709

Closed

Description

@j-manu

Though I applaud the intent behind https-everywhere, rewriting a CDN domain name to S3 bucket is very problematic.

  1. You cannot guarantee that the domain will always resolve to that S3 bucket and apparently there are no checks to ensure that domain names are resolving to the S3 bucket (as happened in Please disable rule for PrintFriendly #2708 )
  2. Bucket names can be reused. If I delete the S3 bucket someone else can create a bucket with that name. Even if the original owner updated his code to not use the bucket anymore, https-everywhere will continue redirecting and end users will not be aware of it. I think this is a bigger threat to privacy than not having SSL.

Activity

  1. jeremyn commented on Sep 3, 2016

    @jeremyn
    Contributor

    I agree that rewriting anything to an S3 bucket is a bad idea. I think reviewers should not allow that in future rulesets. @fuglede @Hainish @J0WI What do you all think?

  2. jeremyn commented on Sep 3, 2016

    @jeremyn
    Contributor

    Here is another example of rewriting to an external CDN, this time to CloudFront.

  3. J0WI commented on Sep 4, 2016

    @J0WI
    Contributor

    It's sometimes necessary to avoid mismatching certs and mixed content, but indeed they need special attention during the review process.
    Test urls can help to detect broken redirects.

  4. jeremyn commented on Sep 4, 2016

    @jeremyn
    Contributor

    Issue #6624 is related.

  5. jeremyn commented on Sep 4, 2016

    @jeremyn
    Contributor

    As @j-manu said though, bucket names can be reused. It doesn't matter how careful we are during the review process. After the rule is merged, all that needs to happen is for @j-manu to delete the bucket and for someone else to claim the name, and now we're directly creating a MITM situation.

  6. fuglede commented on Sep 6, 2016

    @fuglede
    Contributor

    Do people have any control of the names of buckets they use? How are the subdomains generated in the CF case, and are the Amazon ones really open to anybody?

  7. jeremyn commented on Sep 6, 2016

    @jeremyn
    Contributor

    Here is Amazon S3 documentation:

    Bucket ownership is not transferable; however, if a bucket is empty, you can delete it. After a bucket is deleted, the name becomes available to reuse, but the name might not be available for you to reuse for various reasons. For example, some other account could create a bucket with that name. Note, too, that it might take some time before the name can be reused. So if you want to use the same bucket name, don't delete the bucket.

    So @j-manu 's situation was that they had a bucket named cdn.printfriendly.com accessible at https://s3.amazonaws.com/cdn.printfriendly.com/ . If they deleted the bucket, I can claim it later and now the PrintFriendly.com ruleset will redirect to a URL under my control.

    I don't know how it works with CloudFront.

  8. fuglede commented on Sep 6, 2016

    @fuglede
    Contributor

    Thanks for the reference. Am I wrong or are they saying that everybody but the original owner can use the bucket name? Seems a bit strange. In any case, I agree that that's not ideal. I seem to remember that some subset of the Amazon buckets were removed a while ago, but the exact occurrence escapes me.

  9. jeremyn commented on Sep 6, 2016

    @jeremyn
    Contributor

    There might be weird backend things happening that make it difficult for a former owner to immediately reuse a bucket with the same name. If so, that is probably unintentional.

  10. pipboy96 commented on Mar 28, 2019

    @pipboy96
    Contributor

    I want to do exactly that, checking which CDN unwrapping redirects are still neccesary, and which should be turned into trivial rewrites.

  11. self-assigned this
    on Mar 28, 2019
  12. zoracon commented on Jan 9, 2020

    @zoracon
    Contributor

    Mentioning #17912

    Once that issue closes we can close this one

  13. self-assigned this
    on Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions