Enforce mime-type check when loading Origin Policy manifest.
This CL modifies OriginPolicyFetcher to enforce that Origin Policy manifests load with the mimetype application/originpolicy+json If an incorrect mime type is received, loading is aborted, and the OriginPolicy object is returned with an empty policy and status kNoPolicyApplies. Since this same pathway is hit if the manifest load returns 404, we can also set kNoPolicyApplies in that case as well, and a test is included for that. The test includes a valid CSP which, if applied, would lead the test to fail as eval() would not succeed. If the manifest is rejected due to its incorrect mimetype, then the test passes. Bug: 1051169 Change-Id: I59e5bde20c8a21a4fae8dbc3c6f58f34cb292195 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080696Reviewed-by:Daniel Vogelheim <vogelheim@chromium.org> Reviewed-by:
Domenic Denicola <domenic@chromium.org> Commit-Queue: James MacLean <wjmaclean@chromium.org> Cr-Commit-Position: refs/heads/master@{#748364}
Showing
Please register or sign in to comment