On 16 November 2026, visitors to the websites of 178 organizations ran malicious JavaScript. The list included banks, airlines, retailers, streaming services and news sites. The code skimmed payment cards from on-page forms, swapped crypto wallet addresses, sent cookies and screenshots to the attacker, and loaded exploit kits on older iPhones.
None of these brands shipped that code. It arrived through a third-party experimentation script that each site loaded on every page. An attacker wrote into the vendor-hosted "project JavaScript", and the vendor CDN served it with a valid TLS certificate. The Report URI team, who tracked the incident hour by hour, put it plainly: allowlisting the vendor CDN in a Content Security Policy "was never going to help."
The vendor was the entry point. The weakness is an architecture that many personalization and experimentation tools share, and this post is about that architecture and the alternative we built with Uniform Context.
The common setup for client-side personalization and A/B testing looks like this:
- You add a
<script src="https://cdn.vendor.com/your-project.js"> tag to every page. - Marketers and agencies change experiments, audiences and custom code in the vendor dashboard.
- The vendor rebuilds the script and its CDN serves the new version on the next page view.
This setup makes it fast to launch a test. It also means that:
- Any person or API token with write access to the vendor account can change the JavaScript on your checkout page.
- That change does not pass through your pull requests, code review, tests or release approvals.
- Your Content Security Policy must trust the vendor domain, so it trusts every future version of that script.
- The script runs with full access to the page: forms, cookies that are not HttpOnly, the clipboard and outgoing requests.
For a leader, the useful question is: who can change the code that runs on our most sensitive pages, and does that change go through our process? With runtime-injected scripts, the honest answer is "more people than we think, and no."
We designed Uniform Context around four rules:
- First-party JS only. Context is an npm package that your build bundles into your app.
- No vendor calls to pick a variant. The decision happens in your stack: in the browser, on your server or at your CDN.
- Every change goes through your SDLC. Code and rules ship with your deployments.
- A small, measured bundle. About 11 KB gzip for the engine.
The rest of this post goes through each rule and then shows how Context runs in Next.js App Router, at the CDN edge, and inside React and Vue.
You install @uniformdev/context like any other dependency. The version is pinned in your lockfile. Your bundler includes it in your own JavaScript, and your domain serves it.
There is no Uniform script tag in your HTML. Your CSP can keep script-src 'self' with no exception for personalization. Your existing supply-chain controls, such as dependency review, lockfile audits and software composition analysis, cover Context the same way they cover React.
The Context engine scores each visitor against signals (for example, a UTM campaign, a visited page or a returning visit) and picks variants from those scores. The engine has no network code of its own. It does not call Uniform to decide what a visitor sees.
Visitor scores live in first-party storage on your domain. Data leaves the page only through plugins that your team adds, such as a Google Analytics or Segment integration, and those plugins are also code in your repo.
This has two results. A page view does not wait on a vendor round trip, and there is no vendor endpoint in the path that an attacker can use to deliver code.
Personalization needs two kinds of change: marketers change rules often, and engineers change code rarely. Context keeps both inside your delivery process.
Editors define signals, enrichments, A/B tests and personalizations in Uniform, with the same workflow they have today. Your pipeline pulls those rules as a manifest with uniform context manifest get and ships the manifest with the build. An SDK upgrade is a package.json diff in a pull request. A rollback is a redeploy of a known-good build.
Marketers keep their speed. Engineering keeps control of what code runs, and every change has a commit, an author and a deployment record.
Third-party tags often add weight that nobody on the team measured. We measured Context.
What you import | Minified + gzip | Brotli |
|---|
Context engine (@uniformdev/context) | 11.0 KB | 9.9 KB |
Engine + Vue bindings (@uniformdev/context-vue) | 13.3 KB | 12.0 KB |
Engine + React bindings (@uniformdev/context-react) | 14.1 KB | 12.7 KB |
Every engine export | 15.9 KB | 14.2 KB |
Method: version 20.89.0, bundled with esbuild 0.28.1 as minified ESM for the browser. React and Vue are not counted because your app already includes them.
Personalization and caching often work against each other. If every visitor can see a different page, the usual options are to render each request on the server or to swap content in the browser after load. Both cost performance.
The Uniform SDK for Next.js App Router treats each personalization result as its own cacheable page.
- Middleware evaluates the visitor's signals from cookies, geo, UTM parameters and headers.
- It encodes the result as a short code and rewrites the request to a route keyed by that code. The visitor's URL does not change.
- React Server Components render that route with Next.js 16 Cache Components (
'use cache'), once per code.
Visitors with the same result share one cache entry. The HTML that reaches the browser is already personalized, so there is no client-side swap and no flash of default content.
Not every site runs on Next.js. For those sites, Context includes NESI, an edge-side include format for personalization.
Your app renders each personalized slot with all of its variants, wrapped in NESI markers. That response is the same for every visitor, so your CDN can cache it. At the edge, a worker:
- reads the HTML as a stream, chunk by chunk, so it does not hold the whole page in memory before it starts to send;
- scores the visitor from first-party data;
- writes the chosen variant and drops the others;
- passes the decision to the client, so client-side Context agrees with the edge.
Uniform provides adapters for Cloudflare, Akamai, Netlify and Vercel. NESI works on HTML, so the origin can use React, Vue, Svelte, Remix or static HTML. Variants that a visitor does not qualify for never reach that visitor's browser.
React and Vue keep their own model of the page in memory, often called the virtual DOM. They update the real DOM to match that model, and they expect the real DOM to stay that way.
A script that edits the DOM after the framework renders, for example to replace text, move nodes or hide elements, works outside that model. The framework does not know about those edits. On the next re-render or during hydration, the framework can overwrite the change or report a hydration mismatch. Visitors see flicker. Engineers get bug reports that are hard to reproduce.
Context works inside the framework. In React and Vue, <Personalize> and <Test> are components in your tree, and the framework renders the selected variant like any other component. With NESI, the edge resolves the variant before the browser receives the HTML. In both cases, no script edits the page behind the framework.
The November incident is a useful reason to look at how personalization and experimentation run on your sites. Ask your team:
- Can a vendor dashboard or API token change the JavaScript on our checkout and login pages?
- Does our CSP allow a third-party script domain for personalization or testing?
- Does a page view wait on a vendor network call before content is final?
- Is the code that runs personalization versioned in our repo and released through our pipeline?
If the answers make you uncomfortable, the fix is architectural. Personalization can ship as part of your application, with your review process, on your domain, at a size you can measure.
That is how we built Uniform Context.