Integrity hash without crossorigin

How the scan finds files that carry an integrity hash but no crossorigin attribute, when it fails, and how to make the hash work.

What AuditX checks

The scan reads the HTML the server sends for the page you scanned, and looks at every script with a src and every stylesheet link with an href. A file counts as cross-origin when its address starts with http:// or https:// and does not start with the origin of the page, which is the scheme, host and port. This is stricter than the plain third-party scripts check, because a file on a subdomain such as cdn.example.com is also cross-origin here. For each cross-origin file, the scan looks for an integrity attribute and for a crossorigin attribute. Any crossorigin attribute counts, whatever its value. The check fails when at least one file has integrity but no crossorigin, and the message names up to 5 files. Otherwise it is an info note, which does not lower the score, saying that this does not apply. It never passes or warns. Files without any integrity attribute are not counted here, because another check covers them. Files from your own origin are skipped. Other pages of the site are not read. A fail lowers the security score. This check never caps the overall score.

Why it matters

MDN explains that a request for a file with an integrity hash must use CORS, and that as a result you must include the crossorigin attribute in your markup. Without it the protection you added does not do its job.

MDN describes Subresource Integrity as a way for browsers to check that files fetched from a CDN arrive without unexpected manipulation. A hash that is not applied gives a false sense of safety.

How to fix it

  1. Add crossorigin="anonymous" next to the integrity attribute on each file the report names.
  2. Check that the host of the file allows cross-origin requests. Public CDNs usually do. If the host does not, the browser blocks the file, so test the page after the change.
  3. Whenever the file changes to a new version, create a new hash and update the integrity value. MDN notes this is extra upkeep.
  4. Scan again and make sure every cross-origin file with a hash also has crossorigin.
<script src="https://cdn.example.com/lib/1.2.3/lib.min.js"
  integrity="sha384-HASH_OF_THE_FILE"
  crossorigin="anonymous"></script>

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.