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

In HTTP Nowhere mode, attempt HTTPS before block. - #7435

Merged
cooperq merged 2 commits into
masterfrom
https-attempt
Dec 9, 2016
Merged

cooperq merged 2 commits into
masterfrom
https-attempt

Conversation

@jsha

@jsha jsha commented Oct 25, 2016

Copy link
Copy Markdown
Member

This applies to both main frame resources and subresource loads, though in
practice only image subresources get a chance to be rewritten, due to mixed
content blocking.

Loop detection still works, so pages that redirect back to HTTP will get caught
by that and eventually get the "cancelled by extension" message.

Fixes #2115

jsha and others added 2 commits October 24, 2016 21:20
This applies to both main frame resources and subresource loads, though in
practice only image subresources get a chance to be rewritten, due to mixed
content blocking.

Loop detection still works, so pages that redirect back to HTTP will get caught
by that and eventually get the "cancelled by extension" message.
@Hainish

Hainish commented Nov 5, 2016

Copy link
Copy Markdown
Member

Reviewed WebExtensions code, lgtm. Added XPCOM code, @jsha can you review?

@Hainish

Hainish commented Nov 6, 2016

Copy link
Copy Markdown
Member

@cooperq do you have time to review this with me on Monday?

Comment thread chromium/background.js
return {redirectUrl: newuristr.replace(/^http:/, "https:")};
}
}
if (newuristr && newuristr.substring(0, 5) === "http:") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if clause is redundant and should probably be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not: the previous clause (if (shouldCancel)) covers the case where the request started with an HTTP request. This clause (if (newuristr && newuristr.substring(0, 5) === "http:")) covers the case where we started on an HTTPS page and got redirected to HTTP (by 301 or by a downgrade rule).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I rescind my comments then.

@cooperq
cooperq merged commit 0321ff8 into master Dec 9, 2016
@Hainish
Hainish deleted the https-attempt branch December 12, 2016 21:27
@gloomy-ghost

gloomy-ghost commented Feb 14, 2017 •

Copy link
Copy Markdown
Collaborator

Hey guys, @ivysrono just talked to me about UpgradeMixedContent. It's an extension that inserts upgrade-insecure-requests to every https page so browsers can rewrite http requests before start mixed content blocking.

The flaw is inserting such a header let browsers also rewrite display content while it's not blocked by default. If the display content isn't available for HTTPS, it fails. It's quite aggressive to do so for normal users who think http images don't really hurt, but it might be a good way for http-nowhere mode. Any thoughts?

@jsha

jsha commented Feb 14, 2017

Copy link
Copy Markdown
Member Author

Could you open a fresh issue for this?

@Hainish

Hainish commented Feb 14, 2017

Copy link
Copy Markdown
Member

@gloomy-ghost tag me when you open the issue please

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants