Vendor SDK Pinning for Web Device Mode

The JavaScript SDK loads exact, integrity-checked versions of supported vendor SDKs, and a strict option skips destinations it cannot pin.
Available Plans
  • free
  • growth
  • enterprise

From version 3.36.0, the JavaScript SDK loads an exact, tested version of each supported vendor SDK in web device mode and verifies it with Subresource Integrity (SRI). If the vendor’s file changes, the browser blocks it instead of running it on your page. The new vendorSdkVersionPolicy load option goes further: set it to strict, and the SDK skips every device mode destination whose vendor script it cannot pin.

See Vendor SDK version policy for full details.

Why pin vendor SDK?

Web device mode destinations load the vendor’s own SDK into your website, and most vendors serve it from a URL that always returns their latest release. Whatever that URL returns runs on your pages with full access to them, so a compromised vendor CDN or a faulty vendor release reaches your visitors without any change on your side.

Pinning fixes the vendor SDK version, and the SRI check makes the browser refuse any file whose contents differ from the version the SDK expects.

Key features

  • Pinned by default: For Amplitude, Bugsnag, Iterable, Keen, LaunchDarkly, Rollbar, and Sentry, the SDK loads a fixed vendor SDK version with an SRI check. No setting is needed.
  • Strict policy: Set vendorSdkVersionPolicy to strict to load only the destinations the SDK can protect. The SDK skips the rest before they add any script to your page and logs each destination it skips.
  • What still loads in strict mode: Destinations that load no vendor script (Lotame, Ninetailed, Optimizely Web, and Shynet), custom integrations you register with the SDK, and destinations where you set the vendor script URL yourself (Google Analytics 4, Google Ads, Appcues, Rockerbox, and Mixpanel).
  • Content Security Policy guidance: Web device mode destination pages list the vendor script URLs to allow in script-src: exact URLs for pinned vendor SDKs, and hosts for the rest.

Known limitations

  • Most vendors, including Google and Meta, serve their SDKs only from unversioned URLs, so the SDK cannot pin them. In strict mode, these destinations do not load. Use cloud mode for them where the destination supports it.
  • Pinned vendor SDK URLs change when you upgrade the JavaScript SDK. Update your Content Security Policy when you upgrade.

Get started

  1. Upgrade the JavaScript SDK to version 3.36.0 or later. CDN installations that load the v3 path already use it.
  2. To skip destinations whose vendor scripts cannot be pinned, set the policy in your load call:
javascript
rudderanalytics.load(WRITE_KEY, DATA_PLANE_URL, {
  vendorSdkVersionPolicy: "strict"
});
  1. Check your browser console for Skipped <destination>: its vendor script cannot be pinned (strict mode). and move those destinations to cloud mode where supported.
  2. If your website uses a Content Security Policy, allow the vendor script URLs listed on each destination page.

See the Harden JavaScript SDK guide for a complete hardened setup.

Resources

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.