Https-first: Investigate whether commented out code adding upgrade exception is necessary or can be removed
Categories
(Core :: DOM: Security, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | wontfix |
firefox129 | --- | wontfix |
firefox130 | --- | wontfix |
firefox131 | --- | fixed |
People
(Reporter: manuel, Assigned: manuel)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [domsecurity-active])
Attachments
(1 file)
After review, before landing one code path that added an exception was commented out. The test coverage is very good, and it has been in Stable for some time, so probably not much or nothing breaks, but should be investigated if we behave incorrect in some scenarios.
Diff that commented the code out: https://phabricator.services.mozilla.com/D193672?vs=872230&id=872764#toc.
Either remove the code block that is commented out or remove the /*
and */
in /dom/security/nsHTTPSOnlyUtils.cpp#412,423
// https-first needs to account for breaking upgrade-downgrade endless
// loops at this point for meta and js redirects because this function
// is called before we
// check the redirect limit in HttpBaseChannel. If we encounter
// a same-origin server side downgrade from e.g https://example.com
// to http://example.com then we simply not annotating the loadinfo
// and returning false from within this function. Please note that
// the handling for https-only mode is different from https-first mode,
// because https-only mode results in an exception page in case
// we encounter and endless upgrade downgrade loop.
/*
bool isUpgradeDowngradeEndlessLoop = IsUpgradeDowngradeEndlessLoop(
aURI, aURI, aLoadInfo,
{UpgradeDowngradeEndlessLoopOptions::EnforceForHTTPSFirstMode});
if (isUpgradeDowngradeEndlessLoop) {
if (mozilla::StaticPrefs::
dom_security_https_first_add_exception_on_failiure()) {
nsHTTPSOnlyUtils::AddHTTPSFirstExceptionForSession(aURI, aLoadInfo);
}
return false;
}
*/
Comment 1•11 months ago
|
||
Set release status flags based on info from the regressing bug 1747230
Updated•11 months ago
|
Comment 2•11 months ago
|
||
Freddy, can you help find an owner for this issue? Or, Manuel, if you intend to work on it, can you take ownership? Thanks!
Assignee | ||
Comment 3•11 months ago
|
||
I took a look now. There exist a test cases describing exactly the scenario and they are passing.
{ query: "downgrade_redirect_meta", result: "http" },
{ query: "downgrade_redirect_js", result: "http" },
The code is not necessary. I verified that the test case working as intended.
Assignee | ||
Comment 4•11 months ago
|
||
Commented out in Bug 1747230, but could have been removed instead.
Comment 5•11 months ago
|
||
Thank you, Manuel.
Comment 7•11 months ago
|
||
bugherder |
Comment 8•11 months ago
|
||
The patch landed in nightly and beta is affected.
:manuel, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox130
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Updated•11 months ago
|
Description
•