Skip to content

Exclude localhost from HTTPS upgrades #1780

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

Closed
ericlaw1979 opened this issue Oct 24, 2024 · 0 comments · Fixed by #1781
Closed

Exclude localhost from HTTPS upgrades #1780

ericlaw1979 opened this issue Oct 24, 2024 · 0 comments · Fixed by #1781

Comments

@ericlaw1979
Copy link
Contributor

What is the issue with the Fetch Standard?

http://localhost is already a potentially trustworthy URL. Upgrade-insecure-requests already skips localhost, and HSTS should too. Otherwise, problems occur when a web developer self-hosts multiple services on localhost, or if an end-user attempts to use any of many software packages that use ephemeral localhost web servers.

Currently, https://fetch.spec.whatwg.org/#concept-main-fetch includes:

Set request’s current URL’s scheme to "https" if all of the following conditions are true:

request’s current URL’s scheme is "http"
request’s current URL’s host is a domain
Matching request’s current URL’s host per Known HSTS Host Domain Name Matching results in either a superdomain match with an asserted includeSubDomains directive or a congruent match (with or without an asserted includeSubDomains directive) [HSTS]; or DNS resolution for the request finds a matching HTTPS RR per section 9.5 of [SVCB]. [HSTS] [SVCB]

I propose we add an additional restriction clause:

request’s current URL’s host’s public suffix is not " localhost " or " localhost. "

@annevk annevk closed this as completed in bdb452e Nov 5, 2024
meacer pushed a commit to carlosjoan91/fetch that referenced this issue Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant