Distinguish redirect loop caused by endless HTTPS-HTTP loop
Categories
(Core :: Networking: HTTP, task, P2)
Tracking
()
People
(Reporter: kershaw, Assigned: sekim)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged] [necko-priority-queue])
Attachments
(3 obsolete files)
Currently, Firefox fails to differentiate between redirect loops caused by a cycle between HTTPS and HTTP and other types of redirect loops. Currently, we use the same error code NS_ERROR_REDIRECT_LOOP and show the same error page, leading to potential misinterpretation and difficulty in troubleshooting HTTPS and HTTP loop caused by HTTPS-only or HTTPS-first mode.
The first step might be using a different error code for HTTPS-HTTP loop.
| Reporter | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Currently we show the HTTPS-only error page for errors where a https-only upgrade was involved (including the redirect loop). In some cases this doesn't trigger (when starting at the https page, because then no real https-only upgrade was triggered, only the loop detection). Https-first doesn't show a redirect loop at all, it just loads the http page.
What could be added is to
- show the https-only error page when https-only mode is enabled and the user startet at the https page (i.e. enters
https://example.com/and it redirects tohttp://example.com - don't show the https-only error page when the page has hsts enabled, because hsts has higher priority than https-only mode.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 2•1 year ago
|
||
I guess what we need here is:
- A test for this situation
- A new error code in ErrorList.py
- Return the new error code in nsHttpChannel when upgrading the channel to secure (and a channel in the redirect chain also did a HTTPS upgrade using secure)?
Updated•1 year ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 3•7 months ago
|
||
Hello Kershaw,
Do you have any thoughts on the starting point of this bug? (when checking for a cycle between HTTPS and HTTP)
Perhaps these returns?:
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6148
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6159
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6186
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 4•7 months ago
|
||
Updated•7 months ago
|
| Reporter | ||
Comment 5•7 months ago
|
||
(In reply to Sean Kim from comment #3)
Hello Kershaw,
Do you have any thoughts on the starting point of this bug? (when checking for a cycle between HTTPS and HTTP)
Perhaps these returns?:
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6148
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6159
https://searchfox.org/mozilla-central/rev/be3db2aef8d3916c891527794a2d5e2f2dc9fab1/netwerk/protocol/http/HttpBaseChannel.cpp#6186
Yes, these are the places where we return NS_ERROR_REDIRECT_LOOP.
In addition, I think you might want to take a look at IsUpgradeDowngradeEndlessLoop as well.
| Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 6•7 months ago
|
||
| Assignee | ||
Comment 7•7 months ago
|
||
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 8•7 months ago
|
||
I think we are handling the cases correctly and showing the correct error page:
- When HTTPS-only mode is enabled + redirect loop, we show the HTTPS-only exception page
- When HTTPS-first mode is enabled: When we detect a redirect loop, we show the default redirect loop error page.
If there are any unexpected mismatches in the future, please feel free to reopen this bug.
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Description
•