Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Subresource Integrity
Method to validate website content loaded from third parties

Subresource Integrity or SRI is a W3C recommendation to provide a method to protect website delivery. Specifically, it validates assets served by a third party, such as a content delivery network (CDN). This ensures these assets have not been compromised for hostile purposes.

To use SRI, a website author wishing to include a resource from a third party can specify a cryptographic hash of the resource in addition to the location of the resource. Browsers fetching the resource can then compare the hash provided by the website author with the hash computed from the resource. If the hashes don't match, the resource is discarded.

A sample script element with integrity and crossorigin attribute used by the SRI:

<script src="https://cdn.example.com/app.js" integrity="sha384-+/M6kredJcxdsqkczBUjMLvqyHb1K/JThDXWsBVxMEeZHEaMKEOEct339VItX1zB" crossorigin="anonymous"> </script>
We don't have any images related to Subresource Integrity yet.
We don't have any YouTube videos related to Subresource Integrity yet.
We don't have any PDF documents related to Subresource Integrity yet.
We don't have any Books related to Subresource Integrity yet.
We don't have any archived web articles related to Subresource Integrity yet.

References

  1. "Subresource Integrity". Mozilla Developer Network. Retrieved 14 April 2016. https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity