When the `upgrade-insecure-requests` CSP is in a seperate standalone rule with others existing, too, requests are not upgraded
Categories
(Core :: DOM: Security, enhancement)
Tracking
()
People
(Reporter: skyschub, Assigned: tschuster)
References
(Blocks 1 open bug)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:60
Attachments
(1 file, 4 external files)
|
474 bytes,
text/html
|
Details |
(see comment 1)
Updated•12 days ago
|
Updated•11 days ago
|
| Reporter | ||
Comment 1•5 days ago
|
||
Actually, my original report is wrong. We do upgrade requests before checking CSP, but only if upgrade-insecure-requests is in the same CSP. So a request with a header of
Content-Security-Policy: upgrade-insecure-requests; script-src 'unsafe-inline' https:
works in Firefox, but two CSP headers:
Content-Security-Policy: upgrade-insecure-requests
Content-Security-Policy: script-src 'unsafe-inline' https:
does not work in Firefox, but works fine in Chrome. The attached test-case shows this. This feels like something we can fix!
| Reporter | ||
Updated•5 days ago
|
| Reporter | ||
Comment 2•5 days ago
|
||
Also, while being wrong, I was still wrong - the second page linked to this report is not affected by the same issue, I'll figure that one out in a new bug, the salesforce-issue is more relevant.
| Assignee | ||
Comment 3•5 days ago
|
||
Very interesting, I will have look ASAP.
Updated•5 days ago
|
| Assignee | ||
Comment 4•5 days ago
|
||
The problem in our code is that permitsScheme will allow loading http: schemes as long as aUpgradeInsecure is true and the "enforced"/allowed scheme is https:. However we only set the parameter aUpgradeInsecure based on the existence of the upgrade-insecure-requests directive inside the current Content-Security-Policy. This matches with what you found.
From a specification perspective we are totally wrong here. We never really implemented the CSP 3.0 6.7.2.8. Does url match expression in origin with redirect count? algorithm. That algorithm doesn't even consider upgrade-insecure-requests, instead it maches an URLs that have already been upgraded, because Step 7. of main fetch (the policy enforcement) runs after Step 6. (the upgrading).
I think this also means we have potentially similar issues if the upgrading happens due to a mechanism that isn't CSP's upgrade-insecure-requests.
I am going to upload a patch that fixes this specific issue only.
| Assignee | ||
Comment 5•5 days ago
|
||
Updated•5 days ago
|
Comment 7•4 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•4 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D346130
(cherry picked from commit cb404a4c5f7f5195d7c0e8c20e7d0fceec67191a)
Updated•4 days ago
|
Comment 9•4 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: The login page for Salesforce is broken.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: - Load https://bugzilla.mozilla.org/attachment.cgi?id=9690470
- Make sure there is a green box instead of a red box
- Risk associated with taking this patch: low
- Explanation of risk level: This is a fairly obvious change that just re-uses existing helper methods.
- String changes made/needed?: no
- Is Android affected?: yes
Comment 10•4 days ago
|
||
firefox-esr153 Uplift Approval Request
- User impact if declined/Reason for urgency: The login page for Salesforce is broken.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: - Load https://bugzilla.mozilla.org/attachment.cgi?id=9690470
- Make sure there is a green box instead of a red box
- Risk associated with taking this patch: low
- Explanation of risk level: This is a fairly obvious change that just re-uses existing helper methods.
- String changes made/needed?: no
- Is Android affected?: yes
| Assignee | ||
Comment 11•4 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D346130
(cherry picked from commit cb404a4c5f7f5195d7c0e8c20e7d0fceec67191a)
Comment 12•4 days ago
|
||
firefox-release Uplift Approval Request
- User impact if declined/Reason for urgency: The login page for Salesforce is broken.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: - Load https://bugzilla.mozilla.org/attachment.cgi?id=9690470
- Make sure there is a green box instead of a red box
- Risk associated with taking this patch: low
- Explanation of risk level: This is a fairly obvious change that just re-uses existing helper methods.
- String changes made/needed?: no
- Is Android affected?: yes
| Assignee | ||
Comment 13•4 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D346130
(cherry picked from commit cb404a4c5f7f5195d7c0e8c20e7d0fceec67191a)
Updated•4 days ago
|
Updated•4 days ago
|
Updated•4 days ago
|
Comment 14•4 days ago
|
||
| uplift | ||
Updated•3 days ago
|
Updated•3 days ago
|
Comment 15•3 days ago
|
||
| uplift | ||
Updated•8 hours ago
|
Updated•8 hours ago
|
Comment 16•8 hours ago
|
||
| uplift | ||
Description
•