Reviewing Third-Party Scripts on Your Website
Every external script you add runs with the same power as your own code. Reviewing them regularly is one of the highest-value security habits for any site.
Analytics, chat widgets, ad tags, fonts and CDN libraries all come from servers you do not control. If one of them is changed or compromised, every site that loads it is affected.
Step 1: list what loads
Run your public URL through CodBy and open the source inventory, or use the DevTools Network panel filtered by JS. Note each domain that is not your own.
Step 2: decide for each script
- Is it still used? Remove tags for tools you stopped using.
- Does it need to load on every page, or only where it works?
- Can you self-host it, or load a pinned version instead of
latest? - What data does it receive? Check your privacy policy matches.
Step 3: add protections
For files on a CDN, use Subresource Integrity so the browser refuses a changed file:
<script src="https://cdn.example.com/lib@1.2.3/lib.min.js"
integrity="sha384-BASE64HASH"
crossorigin="anonymous"></script>
Then restrict allowed script sources with a Content-Security-Policy; see the security headers guide.
Keep it up to date
Repeat the review before each release, and compare the new inventory with the last one. The technology detector guide explains how to keep that record.
Open CodBy Analyzer