Closed
Bug 1290529
Opened 9 years ago
Closed 8 years ago
clear HSTS and HPKP for subdomains as well when bug 1115712 is fixed
Categories
(Toolkit :: Data Sanitization, defect)
Toolkit
Data Sanitization
Tracking
()
RESOLVED
FIXED
mozilla54
People
(Reporter: keeler, Assigned: jhao)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
bug 1119778 will ensure that HSTS and HPKP will be cleared for the exact domain used with "Forget About This Site", but ideally it should clear that information for subdomains as well. Until bug 1115712 is fixed, this isn't possible.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jhao
Status: NEW → ASSIGNED
Assignee | ||
Updated•8 years ago
|
Blocks: FirstPartyIsolation, meta_tor
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
Hi Matt and Mark, would you review this patch, please? This patch depends on the one in bug 1115712.
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review106390
::: toolkit/forgetaboutsite/ForgetAboutSite.jsm:210
(Diff revision 1)
> + let hostname = entry.QueryInterface(Ci.nsISiteSecurityState).hostname;
> + if (hostname.endsWith("." + aDomain)) {
> + let uri = caUtils.makeURI("https://" + hostname);
> + sss.removeState(type, uri, 0);
> + }
Please add a comment explaining what this is about.
Attachment #8827806 -
Flags: review?(MattN+bmo)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review106390
> Please add a comment explaining what this is about.
Done. Please take a look again. Thanks.
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review106518
::: toolkit/forgetaboutsite/ForgetAboutSite.jsm:212
(Diff revision 2)
> + let hostname = entry.QueryInterface(Ci.nsISiteSecurityState).hostname;
> + if (hostname.endsWith("." + aDomain)) {
> + let uri = caUtils.makeURI("https://" + hostname);
> + sss.removeState(type, uri, 0);
> + }
I meant the 4 lines I quoted with the endsWith and makeURI. What is the `if` doing and why do we need ot make a new URI?
Attachment #8827806 -
Flags: review?(MattN+bmo)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review106518
> I meant the 4 lines I quoted with the endsWith and makeURI. What is the `if` doing and why do we need ot make a new URI?
I've added more comments. Thanks.
Comment 9•8 years ago
|
||
mozreview-review |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review106566
Thanks
::: toolkit/forgetaboutsite/ForgetAboutSite.jsm:213
(Diff revision 3)
> + // information in the site security service.
> + let enumerator = sss.enumerate(type);
> + while (enumerator.hasMoreElements()) {
> + let entry = enumerator.getNext();
> + let hostname = entry.QueryInterface(Ci.nsISiteSecurityState).hostname;
> + // If the hostname is aDomain's subdomain, we remove it's state.
Remove the apostrophe in "it's"
Attachment #8827806 -
Flags: review?(MattN+bmo) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8827806 -
Flags: review?(mgoodwin) → review?(dkeeler)
![]() |
Reporter | |
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review107594
PSM test looks good to me, although I noted an improvement that probably should have been there in the first version.
::: security/manager/ssl/tests/unit/test_forget_about_site_security_headers.js:95
(Diff revision 4)
> yield ForgetAboutSite.removeDataFromDomain("example.com");
>
> - // TODO (bug 1290529):
> - // Assert.ok(!sss.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
> - // "a.pinning2.example.com", 0),
> - // "a.pinning2.example.com should not be HSTS now (subdomain case)");
> + Assert.ok(!sss.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
> + "a.pinning2.example.com", 0),
> + "a.pinning2.example.com should not be HSTS now (subdomain case)");
> + Assert.ok(!sss.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
It occurs to me we should probably add a test that unrelated sites don't also get removed when example.com is forgotten (as in, also process headers for something like example.org and ensure that it isn't affected).
Attachment #8827806 -
Flags: review?(dkeeler) → review+
Assignee | ||
Comment 12•8 years ago
|
||
The WIP patch for the new test that David suggested.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8829698 -
Attachment is obsolete: true
Assignee | ||
Comment 14•8 years ago
|
||
(In reply to Jonathan Hao [:jhao] from comment #13)
> Comment on attachment 8827806 [details]
> Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
>
> Review request updated; see interdiff:
> https://reviewboard.mozilla.org/r/105396/diff/4-5/
David, is this what you want?
Flags: needinfo?(dkeeler)
![]() |
Reporter | |
Comment 15•8 years ago
|
||
mozreview-review |
Comment on attachment 8827806 [details]
Bug 1290529 - Clear HSTS and HPKP for subdomains in ForgetAboutSite.
https://reviewboard.mozilla.org/r/105396/#review107944
Yep - that's what I was thinking. LGTM (just the nit about the comments)
::: security/manager/ssl/tests/unit/test_forget_about_site_security_headers.js:97
(Diff revisions 4 - 5)
> + let unrelatedURI = Services.io.newURI("https://example.org");
> + sss.processHeader(Ci.nsISiteSecurityService.HEADER_HSTS, unrelatedURI,
> + GOOD_MAX_AGE, sslStatus, 0);
> + Assert.ok(sss.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
> + "example.org", 0),
> + "example.org should be HSTS (subdomain case)");
nit: I would take out the "(subdomain case)" bit
::: security/manager/ssl/tests/unit/test_forget_about_site_security_headers.js:110
(Diff revisions 4 - 5)
> "a.pinning2.example.com", 0),
> "a.pinning2.example.com should not be HPKP now (subdomain case)");
> +
> + Assert.ok(sss.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
> + "example.org", 0),
> + "example.org should still be HSTS (subdomain case)");
same here
![]() |
Reporter | |
Updated•8 years ago
|
Flags: needinfo?(dkeeler)
Comment hidden (mozreview-request) |
Comment 17•8 years ago
|
||
Pushed by jhao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5346a3afb036
Clear HSTS and HPKP for subdomains in ForgetAboutSite. r=keeler,MattN
Comment 18•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•