Blog

Third-party scripts security and SRI hashes in 2026

A compromised ad tag on major Dutch websites quietly distributed malware to visitors. Here is why third-party scripts are your biggest blind spot and how Subresource Integrity hashes protect you.

· Published

The incident: malware delivered without a single click

In November 2026, visitors to major Dutch news and media websites including VI.nl, GeenStijl, Bright, and Autoblog were exposed to malicious JavaScript. Visitors did not need to click a banner or download an attachment: simply opening an article triggered the code in their browser, harvesting device data and probing for WebKit vulnerabilities on unpatched iPhones.

Crucially, the publishers’ own web servers were never breached. Their CMS passwords were safe and their databases untouched. The vulnerability occurred further down the supply chain: an unauthorized party compromised an external ad tag management system, injecting malicious code into tags loaded across dozens of publications.

The blind spot: your website runs code you never wrote

Most website owners believe their site is secure as long as their CMS is up to date and an SSL certificate is active. In modern web development, that assumption is dangerous. The average business website or online store loads between 15 and 30 external scripts:

  • Analytics and tracking pixels: Google Tag Manager, Meta Pixel, LinkedIn Insight Tag.
  • User experience tools: live chat widgets, Hotjar heatmaps, feedback forms.
  • Social proof and trust: review widgets from Trustpilot or Kiyoh.
  • Utilities: cookie consent banners, web fonts, video embeds.

When you include an external script via a standard <script src="..."> tag, you grant that third party full execution privileges in your visitor’s browser tab. The browser makes no distinction between your code and external code: the script can inspect anything the visitor sees, read input fields, and initiate network requests.

Why HTTPS does not protect against compromised scripts

A common misconception is that a green padlock (HTTPS) keeps visitors safe from malicious code. It does not. HTTPS protects the transport channel: it ensures nobody on a public Wi-Fi network can eavesdrop on traffic between your visitor and your server.

However, HTTPS does not verify the integrity or intent of the code being transmitted. If your site requests an external script from a server that has been compromised, your server and CDN will faithfully deliver that malicious code over a valid HTTPS connection. The padlock remains green while the code executes in the background.

Beyond publishing: Magecart and formjacking in e-commerce

While the media incident involved advertising networks, the threat is even more severe for online shops, SaaS companies, and B2B portals. In e-commerce, this attack pattern is known as Magecart or formjacking.

Attackers compromise an innocent utility script, such as a live-chat popup or accessibility widget. Once loaded, the script listens to form inputs on checkout and login pages. When a customer enters their credit card number, password, or address, the script quietly exfiltrates a copy to an attacker-controlled server. Because normal orders continue to process without error, such breaches often remain undetected for months.

How MetriXs is architected differently

Because analytics trackers are embedded on every page, analytics vendors must adhere to the highest security standards. MetriXs is built from the ground up to prevent supply-chain risks:

  • Zero runtime dependencies: The MetriXs tracker has literally zero npm dependencies. It is written in pure vanilla JavaScript without external libraries, polyfills, or dynamic remote loaders.
  • Strict network isolation: The script communicates exclusively with a single EU endpoint: https://app.metrixs.eu/api/event. It never connects to ad exchanges or third-party networks.
  • No form access: The tracker has no listeners on input fields or keystrokes. It cannot capture passwords or credit card numbers.
  • Client-side PII scrubbing: Built-in safeguards strip emails, phone numbers, and credit card patterns directly in the browser before data ever leaves the visitor’s device.

Subresource Integrity: cryptographically locking your scripts

For teams with strict compliance requirements, MetriXs supports Subresource Integrity (SRI). SRI is a W3C security standard where you provide a base64-encoded cryptographic hash of the script in your HTML:

<script
  defer
  data-domain="yourdomain.com"
  src="https://app.metrixs.eu/tracker.js?v=1.1.0"
  integrity="sha384-34gRoLswM81WFwPdeZp/+ilDckJFJ29wbav0ymg+GYSaGA208wrak4uZXzFn2zgo"
  crossorigin="anonymous">
</script>

When a visitor’s browser downloads the script, it computes the SHA-384 hash and compares it against the integrity attribute. If even a single byte differs, the browser refuses to execute the script.

You can find the verified hashes for every release in our Tracker Releases & SRI Hashes documentation.

Three practical defenses for webmasters

  1. Clean up Google Tag Manager: Audit all active tags. Remove tracking pixels, chat tools, and experimental scripts from past campaigns that are no longer needed.
  2. Enforce a Content Security Policy (CSP): Tell browsers which origins may execute JavaScript (script-src) and receive data (connect-src). A strict policy prevents hijacked tags from communicating with unauthorized servers.
  3. Use SRI or reverse-proxying: For critical scripts, pin exact integrity hashes or proxy tracking through your own domain.

Frequently asked questions

What is Subresource Integrity (SRI)?
Subresource Integrity is a security feature that enables browsers to verify that resources fetched from external servers have not been manipulated. By providing a cryptographic hash, you ensure that only the exact code you approved will run.
Does MetriXs require complex CSP rules?
No. MetriXs only connects to https://app.metrixs.eu for both script loading and event reporting. Adding script-src https://app.metrixs.eu and connect-src https://app.metrixs.eu is all you need.
What happens if a script with SRI is updated on the server?
If the script changes without updating the integrity attribute in your HTML, the browser will block it. For this reason, SRI is used in conjunction with version-pinned URLs such as tracker.js?v=1.1.0, where files are immutable.
Can I proxy MetriXs through my own domain to eliminate external scripts?
Yes. Our official WordPress, Shopware, PrestaShop, Craft CMS, and Grav plugins support serving tracking code directly from your own domain, eliminating all external script origins.

Cookieless analytics built with security first

MetriXs gives you clean visitor metrics, revenue tracking, and built-in security audits without third-party script vulnerabilities. Free plan available, paid from €6/month.

Start 14-day free trial →

Related: Security architecture · Security headers checklist · Noroshi security monitoring · GDPR compliance guide