Skip to main content
LowHeadersOWASP A08:2021CWE-353

How to fix: External script loaded without Subresource Integrity

A script or stylesheet is loaded from an external origin without a Subresource Integrity (SRI) hash. Note: SRI is impractical for continuously-updated third-party vendor scripts (analytics, ads, payment SDKs), which is why the overwhelming majority of production sites, including large, security-conscious ones, don't use it for those; it's most actionable for pinned, versioned static library includes.

Why it matters

Without SRI, if the CDN or third-party host serving the resource is compromised, attackers can replace the file with malicious code that executes in every visitor's browser, a supply chain attack.

SRI allows browsers to verify that a fetched resource has not been tampered with by checking a cryptographic hash.

How to fix it

  1. 1Generate hash: openssl dgst -sha384 -binary file.js | openssl base64 -A
  2. 2Add integrity="sha384-HASH" and crossorigin="anonymous" to the element
  3. 3Lock CDN URLs to specific versioned filenames

Code examples

Script with SRI

HTML
<script
  src="https://cdn.example.com/lib.min.js"
  integrity="sha384-COMPUTED_HASH"
  crossorigin="anonymous"
></script>

References

Detected automatically by VulnRadar. The check id is sri-missing, stable across every scan so you can filter or diff on it.

See every headers check

Questions

How severe is External script loaded without Subresource Integrity?
VulnRadar rates this low severity in the headers category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id sri-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does External script loaded without Subresource Integrity map to?
It maps to CWE-353. In the OWASP Top 10 it falls under A08:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for external script loaded without subresource integrity

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

External script loaded without Subresource Integrity | VulnRadar