Content-Security-Policy upgrade-insecure-requests is applied to <form>s on 127.0.0.0/8
Categories
(Core :: DOM: Security, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox82 | --- | fixed |
People
(Reporter: denschub, Assigned: freddy)
References
Details
(Whiteboard: [domsecurity-active])
Attachments
(1 file)
For a simple form like
<form>
<input type="submit">
</form>
served with a Content-Security-Policy: upgrade-insecure-requests header, the form submission is upgraded to HTTPS even on localhost/127.0.0.0/8.
Given the existence of bug 1447784, the test in dom/security/test/csp/test_upgrade_insecure_loopback.html (which only is testing XHR, not form submissions), and the fact that Chrome seems not to upgrade, I assume this is a bug. :)
Comment 1•5 years ago
|
||
Yeah, that is a bug, in fact we are missing the check nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURL(aURI) in HTMLFormElement.
Probably worth auditing all the other places where we do document->GetUpgradeInsecureRequests or loadinfo->GetUpgradeInsecureRequests.
Maybe we can also extend the loopback test.
Freddy, maybe something for Jens?
| Assignee | ||
Comment 2•5 years ago
|
||
Updated•5 years ago
|
| Assignee | ||
Comment 3•5 years ago
|
||
I have a patch, but the test looks a bit ugly now.
For some reason, the existing request from XHR didn't show up in the observer and I can't easily look at the result of the <form>, so now I have two methods to check for the tests to complete. Testcase 1 still uses the XHR response and I introduced an specialpowers-http-notify-request observer for testcase 2.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
| bugherder | ||
Description
•