Security headers
Subresource Integrity (SRI)
Add an integrity hash to scripts and styles loaded from a CDN, so a changed file is refused.
Why it matters
When you load a file from someone else's server, you trust that server completely. If it is compromised or the file changes, your page runs the new code.
SRI pins the exact file. A changed file is blocked, and the user sees a broken feature instead of an attack.
How to fix it
-
Generate a hash for each external script or stylesheet
-
Add integrity and crossorigin attributes
-
Avoid loading scripts you cannot pin, or self-host them
Prompt for an AI assistant
Copy the text below and paste it into an AI assistant.
You are the person improving this website. Check the item below and fix it if it applies to the site. Item: Subresource Integrity (SRI) Summary: Add an integrity hash to scripts and styles loaded from a CDN, so a changed file is refused. Steps: 1. Generate a hash for each external script or stylesheet 2. Add integrity and crossorigin attributes 3. Avoid loading scripts you cannot pin, or self-host them References: - Subresource Integrity (MDN) (https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) Constraints: - Keep the existing design and tone of voice. - Show the file or section you changed and the suggested final wording. - Do not decide ambiguous points alone; give options and a recommendation. - Do not change anything outside the listed item.
Checked by
-
vuln
Public exposure checks
Related checks
-
Content-Security-Policy (CSP)
Send a Content-Security-Policy that limits where scripts, styles, and frames can come from, instead of allowing everything.
-
Secrets in client JavaScript
Keep API keys and tokens out of the JavaScript that browsers download.
References
-
Subresource Integrity (MDN)
MDN (Mozilla) reference(Official)
Check your site now
Enter a URL and find what is missing before launch, for free.
Run audit