subresource-integrity
What it does
This skill checks the external scripts and styles on a web page and adds integrity hashes to them. It is for developers who load code from outside their own servers.
When to use it
- ✓When a page loads JavaScript or CSS from a CDN without an integrity attribute.
- ✓When reviewing HTML templates that include external script or link tags.
- ✓When someone asks how to protect visitors if a CDN is compromised.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/subresource-integrity/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My site loads scripts from a CDN. How do I make sure nobody can swap them for malicious code?”
5 new skills a week. 1 minute to read.
How it works
The agent finds external files that have no fingerprint and adds one. Browsers then compare each downloaded file with its fingerprint and block any file that does not match.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Add Subresource Integrity to external scripts
When you load JavaScript from a CDN, you're trusting that CDN completely — if it's compromised, attackers can serve malicious JavaScript to all your users. SRI adds a cryptographic hash to the tag; the browser refuses to execute the script if the hash doesn't match the downloaded content, protecting users even if the CDN is compromised or the URL is hijacked.
Quick Reference
- Add integrity="sha384-..." to <script> and <link> tags loading from CDNs
- Always pair integrity with crossorigin="anonymous"
- Generate hashes with openssl or online tools — CDN providers usually supply them
- SRI blocks execution if the file hash doesn't match, preventing CDN compromise attacks
Check
Find all external <script> and <link rel=stylesheet> tags in this HTML that load from CDNs and don't have integrity attributes. List each one.
Fix
Add appropriate integrity and crossorigin attributes to external CDN resources. Generate the SHA-384 hashes for each resource.
Explain
Explain Subresource Integrity, how it protects against CDN compromise, how to generate SRI hashes, and its limitations.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Add Subresource Integrity to external scripts. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/subresource-integrity
FAQ
What is a subresource integrity hash?
It is a short code that describes the exact contents of a file. The browser compares it with the downloaded file before running it.
Do I need this for files my own server hosts?
The skill focuses on external CDN files. Files your site hosts itself are not the main target here.
Does the skill mention the limits of this method?
Yes. It also explains the limitations, so you know what the check does and does not protect against.
Details
Original description by the author
Use when reviewing templates, rendered HTML, or shared components related to Add Subresource Integrity to external scripts. Validate the final browser-facing markup, not just the source framework abstraction.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3041
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.