Bug 199439 - Force HSTS for sites that doesn't support HTTPS
Summary: Force HSTS for sites that doesn't support HTTPS
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.14
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-03 05:36 PDT by Mykola Dekhtiarenko
Modified: 2019-07-08 04:33 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mykola Dekhtiarenko 2019-07-03 05:36:07 PDT
Here is the situation: there two web pages on the same host but on different ports and first one has HTTPS and other one doesn't. After visiting the one that has HTTPS it's impossible to reach second one because safari forces https for all of the webpages with same host without considering port.
Comment 1 Alexey Proskuryakov 2019-07-03 10:21:53 PDT
This sounds like how HSTS is supposed to work. What exactly do you see as a WebKit bug here?
Comment 2 Mykola Dekhtiarenko 2019-07-04 04:41:14 PDT
The problem here that it's not the same site. One is the real system we are developing(this is the one that has HTTPS) and another one is just some kind of mock system that provides different stubs for third party system we are using. This mock system has web page that was made to configure it's behavior and after first visit of real system there is no way to reach mock one because safari forces HTTPS there.
By the way, I checked this case on Chrome and Firefox and I was able to reach mock one after visiting the one with the real system.
Comment 3 Brent Fulgham 2019-07-04 13:58:15 PDT
And the site is not setting the upgrade insecure request or HSTS headers?

This could be due to a safari feature that will preferentially visit the HTTPS version of the site once it knows it exists.

Have you tried deleting website data for the origin?
Comment 4 Mykola Dekhtiarenko 2019-07-08 04:33:24 PDT
I have checked responses and yes, origin returns "Strict-Transport-Security: max-age=31536000; includeSubDomains" header.

I've deleted website data and it haven't helped. To stop such behavior I should also delete HSTS.plist file but it works only until visiting original one.

If it's expected behavior is it any switch or extension with which it's possible to turn it off for testing purpose? And I should mention this again it behaves like that only in Safari, so, I just wonder why is it different?