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. Relative addresses are resolved against the page address. It only judges five address shapes. On unpkg.com and on jsdelivr.net under /npm/, a package is unpinned when it has no version, when the version is a tag such as latest, next, canary, beta, alpha, dev or experimental, when it is only a major or major.minor number such as 3 or 3.1, or when it is another range. A version that starts with three numbers such as 3.6.0 is pinned. On jsdelivr.net under /gh/ and on raw.githubusercontent.com, a file is unpinned when it has no ref or points at main, master, head, latest, develop, dev or trunk. A ref of 7 to 40 hex characters or a version number starting with digits is pinned, and any other ref is skipped. On cdnjs.cloudflare.com under /ajax/libs/ it is unpinned when the version is latest, and on ajax.googleapis.com under /ajax/libs/ when the version is only a major or major.minor number. Every other CDN, and every file on your own site, is skipped. The check warns when at least one file is unpinned, and names up to 5. Otherwise it is an info note, which does not lower the score, saying either that every recognised CDN file is pinned or that none were recognised. It never fails or passes. It does not look at whether a pinned version is old or has known holes. A warn lowers the security score by less than a fail would. This check never caps the overall score.
Why it matters
The OWASP Third Party JavaScript Management Cheat Sheet lists loss of control over changes as a risk. It says there is usually no guarantee that code hosted by a third party stays the same as what you tested, because new things can be pushed at any time.
MDN says that a library developed by a third party has the ability to compromise your site. An address that follows the newest release means that every new release, good or bad, runs on your pages without you seeing it.
How to fix it
- For each address the report names, choose one exact version, such as 4.17.21, and write it in the address in place of latest, a bare name, a major version or a branch.
- Test the page after the change, because the pinned version may differ from the one that was loading before.
- Consider copying the file to your own site, or adding an integrity hash with crossorigin. A hash only works with a pinned version, and you update it when you upgrade.
- Put a reminder in your calendar to review and upgrade pinned files, so that pinning does not mean running old code forever.
<!-- Moving address: follows whatever is newest -->
<script src="https://cdn.jsdelivr.net/npm/lodash@4/lodash.min.js"></script>
<!-- Pinned address: one exact version -->
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></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