Tamper-evident seals on vendor deliveries
Watch it happen
The vendor’s parcel is swapped by Mallory. The bank’s page opens it without checking and runs it for every visitor.
Alice walks in. The bank’s page loads a helper script from an outside vendor (a CDN) with a tag like <script src="https://cdn…/lib.js">.
In bank terms and app terms
| In the bank | In your app |
|---|---|
integrity="sha384-…" attribute on the tag | |
Are you exposed?
Your HTML has <script src="https://…">or<link rel="stylesheet" href="https://…">pointing to another domain without anintegrityattribute.You load libraries from a CDN using a “latest” URL with no pinned version. Your checkout, login or admin pages load third-party scripts.
Add integrity="sha384-…"andcrossorigin="anonymous"to every third-party script and stylesheet tag (the host must allow cross-origin requests, which public CDNs do). Tools like srihash.org can generate the value.Pin an exact version in the URL so the file doesn’t change underneath the fingerprint. Better still, install the library with npm and serve it from your own domain. Remove third-party scripts you don’t need.
Ask your AI tool to fix it
Paste this into Cursor, Claude, Lovable, Bolt or whatever you build with.
Find every script and stylesheet loaded from another domain in this project. For each one, pin an exact version and add an integrity attribute (sha384 hash) plus crossorigin="anonymous". Where possible, instead install the package with npm and bundle it from our own domain. Tell me which third-party scripts can be removed and which cannot be given an integrity hash (for example, ones that change per request).Where this comes from
The facts, figures and fixes on this page were checked against these sources on 25 Oct 2026. They are linked so you can check for yourself.
- Subresource IntegrityMDN Web Docsintegrity sha384 hash; browser refuses a mismatched file; needs crossorigin and CORS; srihash.org
- Subresource IntegrityW3CSpec for integrity hashes (SHA-256/384/512) and the CORS requirement
- crossorigin attributeMDN Web Docscrossorigin="anonymous" makes a CORS request without cookies; CDN must allow it
Spot a mistake or something out of date? Report a correction · How these guides are made and checked
The free, open-source scanner checks for most of the problems in these guides.