Test

View on GitHub

Demonstration of how SRI works

This is a small demo designed to show how SRI (Subresource Integrity) checks work and how they are related to Cross-Domain Script Includes.

Read all about Subresource Integrity here: Subresource_Integrity

Example 1 - A web page includes a Cross-Domain JavaScript file (main.js) and verifies the integrity of the file with SRI:

Example 2 - A web page includes a Cross-Domain JavaScript file (main2.js) and verifies the integrity of the file with SRI. However, this time, the content of the remote JavaScript file has been altered to include malicious code:

Example 3 - A web page includes a Cross-Domain JavaScript file (main2.js) without verifying the integrity of the file using SRI. The content of the remote JavaScript file has been altered to include malicious code: