Subresource Integrity Playground

A CDN parcel on the post’s table: a sha384 from crypto.subtle as integrity, a stylesheet loaded for real as a blob:. If one byte changes, what does your…

Why it matters

One breached CDN can inject code into thousands of sites at once. SRI makes the browser refuse a file whose bytes differ from what you checked, so a CDN cannot quietly swap its contents.

The key idea

integrity pins a file to its exact bytes

Common mistakes

Try it in this playground