MSPs
What Are the Risks of Third-Party Scripts on My Website?
Rodney Hall, COO— AI-assisted and reviewed prior to publication.

Third-party scripts execute in your client's browser with full access to page content, form fields, and session data. Each tag can read payment details, authentication tokens, and customer information before it reaches your servers. When a script vendor's infrastructure is compromised, every website loading that code becomes a vector for data theft, even when your own servers remain secure.
Every tag runs with first-party privileges
Third-party scripts execute with full DOM access, allowing them to read any form field or session data on the page (cside.com). A tag manager snippet or chat widget operates identically to code you wrote yourself. Third-party scripts get equal access to user data and form fields as your own first party code (cside.com). The browser grants no special sandbox, no permission boundary. If the script can be loaded on the page, it can inspect passwords as users type them, capture credit card numbers before encryption, and exfiltrate session tokens to external domains without generating server-side logs your existing monitoring would catch.
Scripts can update silently without your knowledge, changing behavior between security audits and vulnerability scans. A vendor whose code you reviewed six months ago can push new functionality this afternoon. Unless you monitor what the browser actually receives, the change goes unnoticed.
Supply-chain incidents compromise sites at scale
Attacks on Equifax, British Airways, Ticketmaster, and Forbes were achieved with malicious code that was injected into the companies' websites and then run in their users' browsers (jscrambler.com). The attack, attributed to a threat cluster tracked under the "Magecart" umbrella, involved compromising a script (reportedly a modified Modernizr JavaScript library) loaded by the British Airways payment page (safeguard.sh). The attackers modified a single JavaScript library, captured form field data as customers typed payment details and exfiltrated it to an attacker-controlled domain designed to resemble a legitimate British Airways asset domain, and compromised approximately 380,000 transactions before detection. British Airways itself was never breached. The code they trusted was.
Compromising a popular supplier compromises every website that loads its script at once (smart-team.io). In 2024, the Polyfill.io JavaScript service became a supply-chain attack when the domain changed ownership. Websites that continued loading scripts from cdn.polyfill.io began exposing users to malicious JavaScript, including code that redirected mobile visitors to scam or betting sites while using evasion techniques to avoid detection.
Fourth-party risk extends this further. Fourth-party risk is the security and compliance exposure created by scripts, pixels, and services loaded by your third-party vendors, the dependencies of your dependencies. An analytics tag might load an A/B testing library, which in turn loads session replay. The problem is exacerbated by the fact that developers of third-party scripts often include code from other developers that in many cases have sourced code from another developer (darkreading.com). You approved one vendor. Five scripts now run on the page.
How do you inventory the tags actually loading on your pages?
The 2024 Verizon Payment Security Report found that the average eCommerce site loads more than 18 third and fourth-party scripts per page, many with access to payment or personal data. Most organizations cannot name half of them.
Open your client's website in Chrome or Firefox. Press F12 to open DevTools. Navigate to the Network tab, filter by JS or Third-Party Requests, then reload the page. Every external domain that appears is a script you or someone on the team installed, a script one of those scripts loaded, or a script introduced through a compromised integration. You can start with browser DevTools, open the Network tab, filter by third-party domains, and manually catalog what you find.
Document every approved external service: tool and vendor name, business purpose, internal owner, pages where it loads, data it collects or processes, how it was installed, users with administrative or publishing access, date added and next review date. Any script found on the site but missing from the inventory should be investigated. The gap between what your CMS configuration shows and what the browser loads reveals either abandoned integrations or something worse.
For ongoing visibility across multiple client sites, the free AI-visibility check (/check) includes third-party script detection as part of its security scan. Paid tools like Tag Inspector or Blue Triangle provide centralized inventories, but even a quarterly manual audit catches most of the risk if you document what you find and act on it.
What happens when you remove tags nobody uses anymore?
Tags accumulate again within weeks unless you establish ongoing governance. A marketing campaign ends, but the retargeting pixel stays. An employee leaves, their seat in the session replay tool goes unused, yet the 140 KB script still loads on every checkout page.
When you retire a tool, you should remove its scripts and tags, revoke its API keys and tokens, delete any unused webhooks, remove the vendor accounts, and make sure that the resource does not appear when loading the public website. Deleting the plugin or tag manager entry is only the first step. Scripts embed themselves in page templates, custom HTML blocks, and CMS integrations. Verify removal by checking the live page in DevTools after deployment.
Tags that were critical during holiday season may not need to run year-round. If a heatmapping tool only informs decisions during a redesign, load it conditionally or remove it between projects. Every persistent tag is another supply-chain dependency, another domain your Content Security Policy must permit, another origin that can silently change behavior. Set quarterly reviews and assign each tag an owner who can justify its continued presence or approve its removal. Compare this quarter's inventory to the last. Anything added outside your change process is either an unauthorized integration or evidence of compromise, and both require immediate investigation.
For MSPs managing multiple client sites, standardizing which tags are approved and maintaining a central inventory across all properties reduces the surface area. Clients will request exceptions, and you should treat each one as an expansion of the threat model. You can explore the guide (/guide) for a structured approach to vendor approval, or review ActiScore's pricing (/pricing) if you need monitoring across multiple environments. Tag accumulation is not a configuration problem. It is a governance problem that security tooling alone cannot fix.
Common questions
Do third-party scripts have the same access as my own code?
Yes. Third-party scripts execute with full DOM access, allowing them to read any form field or session data on the page. A tag manager snippet or chat widget operates identically to code you wrote yourself. The browser grants no special sandbox or permission boundary. If the script can be loaded on the page, it can inspect passwords as users type them, capture credit card numbers before encryption, and exfiltrate session tokens to external domains without generating server-side logs your existing monitoring would catch.
What was the British Airways Magecart attack?
The British Airways attack involved compromising a script loaded by the payment page, reportedly a modified Modernizr JavaScript library. The attackers modified a single JavaScript library, captured form field data as customers typed payment details, and exfiltrated it to an attacker-controlled domain designed to resemble a legitimate British Airways asset domain. Approximately 380,000 transactions were compromised before detection. British Airways itself was never breached—the code they trusted was. This is a classic supply-chain attack where the vendor's infrastructure was compromised.
What is fourth-party risk?
Fourth-party risk is the security and compliance exposure created by scripts, pixels, and services loaded by your third-party vendors—the dependencies of your dependencies. An analytics tag might load an A/B testing library, which in turn loads session replay. Developers of third-party scripts often include code from other developers that in many cases have sourced code from another developer. You approved one vendor, but five scripts now run on the page, each with the same access to user data as your own code.
How do I find out what third-party scripts are loading on my site?
Open your website in Chrome or Firefox and press F12 to open DevTools. Navigate to the Network tab, filter by JS or Third-Party Requests, then reload the page. Every external domain that appears is a script you or someone on the team installed, a script one of those scripts loaded, or a script introduced through a compromised integration. Document every approved external service with its vendor name, business purpose, internal owner, pages where it loads, and data it collects. Any script found on the site but missing from the inventory should be investigated immediately.
How do I properly remove old third-party scripts?
When you retire a tool, you should remove its scripts and tags, revoke its API keys and tokens, delete any unused webhooks, remove the vendor accounts, and verify the resource does not appear when loading the public website. Deleting the plugin or tag manager entry is only the first step. Scripts embed themselves in page templates, custom HTML blocks, and CMS integrations. Verify removal by checking the live page in DevTools after deployment. Set quarterly reviews and assign each tag an owner who can justify its continued presence or approve its removal.