Define SRI Reports to inform site operators of integrity check failures #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR defines SRI Reports, a mechanism to provide site operators with the ability to be notified about integrity check failures for resources they are loading. It will use the Reporting API to dispatch reports.
If assets your site depends on have been modified and fail the integrity check, there is currently no reliable way for a site operator to know. This is raised as a concern on a somewhat regular basis to me as the founder of Report URI where customers wish to implement SRI, but are surprised to learn that there is no feedback mechanism for failures. We have explored several methods to achieve this with JavaScript, but this is undesirable for various reasons, including the requirement to deploy more JavaScript and the difficulty of reliably detecting integrity check failures. This same problem was also raised in a recent whitepaper [1] where the authors had the following to say:
There is further discussion in #20 about the benefits of such a mechanism and how to avoid concerns around security and privacy impacts, which have been considered for this proposal.
Fix #20
[1] The More Things Change, the More They Stay the Same: Integrity of Modern JavaScript
Preview | Diff