forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In CrossSiteDocumentResourceHandler, sniff for parser-breakers.
kScriptBreakingPrefixes contains prefixes that are conventionally used to prevent a JSON response from becoming a valid Javascript program (an attack vector known as XSSI). The presence of such a prefix is a strong signal that the resource is meant to be consumed only by the fetch API or XMLHttpRequest, and is meant to be protected from use in non-CORS, cross- origin contexts like <script>, <img>, etc. Block any matching non-CORS cross-site responses, even if they include the nosniff header, and regardless of their server-provided MIME type. Ignoring the nosniff header in this case allows JSON sent as (e.g.) application/javascript to be blocked, so long as we can detect a strong signal that it's illegal or invalid Javascript. Bug: 795476 Change-Id: I8d8b283777d467bbe9d685ecadca090a0c09f458 Reviewed-on: https://chromium-review.googlesource.com/835003 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/master@{#525608}
- Loading branch information
1 parent
2403a17
commit b569e4a
Showing
18 changed files
with
364 additions
and
74 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
Oops, something went wrong.