Home
/
Blog
/
Technical

Subresource Integrity: what SRI solves and what breaks

The right idea with a practical problem: SRI pins file contents by hash, and third-party vendors update their files without telling you.
TL;DR
Subresource Integrity
WHAT IT IS
An integrity attribute on a script or link tag containing a hash of the file's expected contents. The browser refuses to execute a file that does not match.
WHAT IT SOLVES
A compromised CDN or altered file. Exactly the integrity assurance PCI DSS 6.4.3 asks for.
WHY IT IS RARE ON TAGS
Third parties update their scripts without notice, and every update breaks the hash, which means the script stops loading.
Short on time? SRI is the right idea. Pinning the observed payload achieves it without the breakage.

What is Subresource Integrity?

Subresource Integrity is a browser feature that lets you specify a cryptographic hash of a script or stylesheet, so the browser will refuse to execute the file if its contents do not match that hash. It is implemented with an integrity attribute on the script tag and is one of the more elegant security features in the platform: it shifts trust from the address a file came from to the contents of the file itself. If a CDN is compromised and serves altered JavaScript, the hash no longer matches and the browser refuses to run it, with no action required from you.
Block a script: enter a URL, a host or a domain and an optional reason, applied to every Payments platform domain
Blocks match a script URL, a host or a domain, and blocking a vendor stops everything it serves, on every domain in your team.

How SRI works

<script src="https://cdn.example.com/lib.js"
        integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
        crossorigin="anonymous"></script>
The browser fetches the file, hashes the contents, compares against the attribute, and executes only on a match. Any change to the file, malicious or legitimate, produces a mismatch and the script does not run.

Where SRI works well

Your own static assets on a CDN. You control the release cycle, so you update the hash when you update the file. This is the ideal case.
Pinned library versions. A specific version of a library at a versioned, immutable URL. The file should never change, and if it does you want to know.
Anything with a build step. If a build generates your markup, generating the hash alongside it is straightforward.
Pinning the observed payload gets the integrity assurance without the breakage.

Why it breaks on third-party tags

Analytics, tag managers, chat widgets and payment SDKs are served from URLs whose contents change whenever the vendor ships. That is deliberate: it is how they deploy fixes without asking every customer to update a tag.
Add SRI to one of those and the next vendor deploy produces a hash mismatch, so the browser refuses to run the script and the feature it powers silently stops working. If that script is on your checkout, you now have an outage caused by your own security control. Which is why almost nobody runs SRI on third-party tags in production, and why 6.4.3 says 'assure the integrity' rather than 'use SRI'.

Achieving the same goal without the breakage

The insight behind SRI is correct: trust the contents, not the address. The problem is enforcing it in markup you have to update by hand.
Recording the payload hash of every script observed in production achieves the same integrity assurance without the fragility. When a vendor ships new code, the change is detected and surfaced for review rather than silently breaking the page. You keep the assurance, and a vendor update becomes a decision instead of an incident.
In the docs
How to do this in Script Monitoring: Install with an HTML script tag explains the immutable script option: a script URL that never changes, with its own Subresource Integrity value.
Sources and methodology
PCI DSS requirement text is quoted from PCI DSS v4.0.1 (June 2024), published by the PCI Security Standards Council, which is the current version at the time of writing. Requirements 6.4.3 & 11.6.1 became mandatory on 31 March 2025. Where we describe a competitor, we describe publicly available information and say so when something should be verified with the vendor. We publish this product and that is a bias worth knowing about while you read.
ASK AN AI
Don’t just take our word for it
Ask your assistant what to look for in a tool for PCI DSS 6.4.3 & 11.6.1.

Frequently asked questions

Partly. It addresses the integrity assurance element well, for the scripts you can apply it to. It does not produce the inventory or the written business justification per script, which are the other two elements of the requirement.
This is the central practical problem: the vendor changes the file contents whenever they deploy, without notifying you. The next deploy breaks your hash and the script stops loading.
The browser refuses to execute the resource entirely. There is no warning-only mode and no partial execution. On a payment page that can mean a broken checkout.
Sha384 is the common choice and sha256 and sha512 are also supported. You can supply multiple hashes, and the browser accepts the resource if any one matches, which is useful during a planned transition.
Partly. The integrity property can be set when creating a script element programmatically, and any script injected by a third party at runtime is outside your control entirely, which is where most of the risk sits.
Yes, for cross-origin resources. Without it the browser cannot read the response to verify it, and the resource is blocked.
No, they answer different questions. A CSP controls which origins may load resources. SRI verifies that a specific file is the file you expected. Running both is sensible where both are practical.
Partly, and we would be careful. Payment SDKs update, sometimes urgently for security reasons, and a hash mismatch means your payment form stops working. Most providers advise against pinning their SDK.
Record the payload hash observed in production and treat a change as a review item rather than a block. You get the integrity assurance 6.4.3 asks for, and a vendor update becomes a decision instead of an outage.
Partly. It protects against the file changing after you pinned it, which covers a compromised CDN. It does nothing about a vendor whose script was malicious at the moment you generated the hash.

Watch the short answer

Does Subresource Integrity (SRI) Satisfy PCI DSS 6.4.3?

Subresource Integrity partly satisfies PCI DSS 6.4.3: it covers the integrity element for the scripts you can apply it to, but not the inventory or the written business justification per script. This video is fair to SRI: how the integrity attribute works, where it works well (your own static assets, pinned library versions, anything with a build step), why it breaks on third-party tags that vendors update without notice, why 6.4.3 says 'assure the integrity' rather than 'use SRI', how payload pinning gets the same assurance without the outage, and how SRI and a CSP answer different questions.

Read the transcript

Partly. Subresource Integrity covers the integrity part of 6.4.3, for the scripts you can apply it to. It doesn't produce the inventory or the written justification per script, the other two parts. Script Monitoring is one tag that watches every script on your payment pages, in every session, and records what each one contains. SRI is an integrity attribute on a script tag, holding a hash of the file's expected contents. The browser hashes what it fetched, and runs it only on a match. Trust moves from the address to the contents. That's real integrity assurance. If a CDN is compromised, the hash stops matching and the script doesn't run. It works well for your own static assets, pinned library versions, and anything with a build step. Third-party tags are different. Analytics, tag managers, chat widgets and payment SDKs change whenever the vendor ships. The next deploy breaks your hash, the browser refuses the script, and the feature it powers silently stops. There's no warning-only mode, so on your checkout that's an outage caused by your own security control. Scripts a third party injects at runtime are out of reach. And SRI can't help if a script was malicious when you hashed it. That's why almost nobody runs SRI on third-party tags in production, and why 6.4.3 says assure the integrity, not use SRI. Payload pinning keeps the idea and drops the breakage. Record the payload hash of every script observed in production. When a vendor ships new code, it comes back for review instead of breaking the page. An update becomes a decision, not an incident. And SRI isn't a replacement for a CSP. A CSP controls which origins may load resources. SRI checks a file is the one you expected. Run both where practical. Script Monitoring pins approval to the payload hash, and builds the inventory and justifications into a weekly evidence pack. Script Monitoring is free for 1,000 page views a month, with 6.4.3 & 11.6.1 included. Pro starts at $99 a month. Start for free at scriptmonitoring.com.

Video page with transcriptWatch on YouTube

See every script on your own checkout.

Install the tag, mark your payment pages, and watch the inventory fill in. Free forever on 1,000 page views a month, no credit card.

Free forever plan. No credit card.