-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Trusted Types mitigation on Brave's Welcome & Rewards pages
JS code in Brave's Welcome and Rewards WebUI pages is not ready yet to migrated to a world where Trusted Types are enforced, so we need to disable the Content Security Policy for Trusted types in those pages for now and return to a pre-Chromium 87 point in order to keep them working. As mentioned above, this affects mainly Brave Rewards, but also Brave's welcome page. Search for 'dangerouslySetInnerHTML' in *.tsx files to find where exactly this is a problem. Chromium change: https://chromium.googlesource.com/chromium/src/+/5cb72d5f4fe919cfff22f3f51a6fc5e690588836 commit 5cb72d5f4fe919cfff22f3f51a6fc5e690588836 Author: Jun Kokatsu <Jun.Kokatsu@microsoft.com> Date: Fri Aug 21 21:27:19 2020 +0000 Enable Trusted Types mitigation on WebUI by default This change enables Trusted Types mitigation on WebUI by default. It enforces use of safe API by default, and any use of unsafe API (e.g. innerHTML, document.write, etc) has to overwrite Trusted Types directives in the CSP header. Therefore this change makes security review or audit of JavaScript code on WebUI a lot easier. Because JavaScript could introduce XSS only by using `trustedTypes.createPolicy` to generate untrusted html or script as Trusted Types, or removing Trusted Types mitigation. And all of those has to be carefully reviewed going forward. Bug: 41905
- Loading branch information
Showing
4 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters