Vue and Nuxt Ecosystem: Fixing RCE and XSS in Nuxt UI and Dropping Deep Reactivity in Vue Test UtilsThematic roundup · digest for November 17
Poster-style graphic of a security shield and modular Vue and Nuxt UI component blocks.
Thematic roundup3 sections≈ 7 min

Vue and Nuxt Ecosystem: Fixing RCE and XSS in Nuxt UI and Dropping Deep Reactivity in Vue Test Utils

It's easy to assume a UI component library like Nuxt UI only cares about how buttons and cards look, so user-submitted Markdown in a chat couldn't possibly compromise the server. Just as sticky is the belief that Vue Test Utils will always forgive mutating a plain props object in place.

Three releases on November 16, 2026 across the Vue and Nuxt ecosystem prove both assumptions can break on the same day. In a Nuxt 3 chat app with a component test suite, that turns into two immediate tasks: closing a code-injection hole during server-side markup rendering and updating tests that will no longer see prop mutations.

Nuxt UI v4.12.1

Let's start with security: Nuxt UI v4.12.1 was triggered by high-severity advisory GHSA-x9jw-j844-v24h, also covered in VueDigest. The issue is RCE (Remote Code Execution — where untrusted input tricks a Node.js or Nitro server into running arbitrary JavaScript).

In a Nuxt 3 chat where user messages or LLM replies arrive as Markdown and render on the server via comark, @nuxtjs/mdc, or @nuxt/content, two pieces lined up. First, Nuxt UI components accept as (tag or component override) and icon props. Second, during server compilation, Vue can build a component from an object with { template: "..." } or a VNode (an internal UI element descriptor). By passing such an object or forged VNode into as or icon via untrusted Markdown, an attacker could execute code directly on the server.

One crucial detail I noticed in the advisory: updating comark or @nuxtjs/mdc alone does not close every attack vector without patching @nuxt/ui. Only sites rendering strictly their own static Markdown files are unaffected. In v4.12.1, components began ignoring template objects and forged VNode values in as and icon, resetting tags like script or iframe to a default element, while ContentSearch dropped double-escaping on search result text (#7374).

Nuxt UI v4.12.2

That first patch stopped RCE, but the same day — November 16, 2026 — brought Nuxt UI v4.12.2. As the v4.12.1...v4.12.2 changelog shows, the fix had to go further. 4.12.1 still left an opening for SSR XSS — stored cross-site scripting where malicious HTML gets injected on the server and runs in every chat visitor's browser.

The reason is straightforward: a string like as="img src=x onerror=..." didn't contain { template } and wasn't named script, so the renderer dropped it straight into the opening HTML tag even on the latest comark and @nuxtjs/mdc. In v4.12.2, any as string other than a valid plain tag name falls back to a standard wrapper element and template-like objects are rejected; the release also fixed lost dynamic attributes added after mount.

To block as-tag injections in a Nuxt 3 app, bump your UI library to at least 4.12.2:

# Update the package in a Nuxt 3 project
npm install @nuxt/ui@^4.12.2
# or with pnpm:
pnpm update @nuxt/ui

After installing, verify package.json and your lockfile (package-lock.json or pnpm-lock.yaml) pin @nuxt/ui to 4.12.2 or higher. That closes GHSA-x9jw-j844-v24h on both the server and the browser side.

Vue Test Utils v2.6.0

While Nuxt UI was patching production, the same day saw Vue Test Utils v2.6.0 (detailed on VueDigest), removing a long-standing test shortcut. PR #2951 disabled automatic deep reactivity for plain objects and arrays passed into props.

Previously, the test runner automatically wrapped those props in a deeply reactive proxy (Vue's wrapper that tracks nested mutations). That masked bugs: a test could mutate a prop field in place and trigger a component re-render, even though mutating props directly violates one-way data flow in a real app. In v2.6.0, plain objects stay non-reactive (already-reactive objects keep their behavior), and passing the same mutated object back into setProps() no longer triggers a re-render.

Here is how to update a test like UserCard.vue to stop mutating props directly:

import { mount } from '@vue/test-utils';
import { reactive } from 'vue';
import UserCard from './UserCard.vue';

// Old unreliable approach (breaks in v2.6.0):
// const user = { name: 'Alice', role: 'guest' };
// const wrapper = mount(UserCard, { props: { user } });
// user.role = 'admin'; // no longer triggers a reactive re-render!

// Correct approach 1: Explicitly wrap in reactive()
test('обновление данных через reactive props', async () => {
  const reactiveUser = reactive({ name: 'Alice', role: 'guest' });
  const wrapper = mount(UserCard, {
    props: { user: reactiveUser },
  });
  reactiveUser.role = 'admin';
  await wrapper.vm.$nextTick();
  expect(wrapper.text()).toContain('admin');
});

// Correct approach 2: Pass a new object via setProps
test('обновление через setProps с новым объектом', async () => {
  const wrapper = mount(UserCard, {
    props: { user: { name: 'Alice', role: 'guest' } },
  });
  await wrapper.setProps({
    user: { name: 'Alice', role: 'admin' },
  });
  expect(wrapper.text()).toContain('admin');
});

In the first test, reactive() explicitly creates a reactive source, and await wrapper.vm.$nextTick() waits for the DOM to update before asserting. In the second, wrapper.setProps() receives a fresh object, mirroring how a parent component actually passes updated data.

Another welcome addition in v2.6.0 is the built-in TeleportStub. <Teleport> moves modals into document.body, causing wrapper.find() to miss them; TeleportStub mounts the content inline inside the wrapper instead:

import { mount, TeleportStub } from '@vue/test-utils';
import ModalDialog from './ModalDialog.vue';

test('содержимое модального окна рендерится внутри wrapper', () => {
  const wrapper = mount(ModalDialog, {
    global: {
      stubs: {
        Teleport: TeleportStub,
      },
    },
  });
  // The selector finds the element without querying document.body
  expect(wrapper.find('.modal-content').isVisible()).toBe(true);
});

By registering TeleportStub in global.stubs, you can assert on .modal-content inside an isolated wrapper without reaching into document.body. On top of that, v2.6.0 adds type inference for emitted event names and payloads, event triggering via VueWrapper.emit, and compatibility fixes for Vue 3.5 and functional components.

The same push toward cleaner server boundaries and debugging showed up recently in Nuxt's urgent v4.6.4 security release and our rundown of Devtools 4.2. To keep your stack upgrade smooth, focus on three checks:

  • Check your lockfile: if you render user- or LLM-generated Markdown, @nuxt/ui must be 4.12.2 or higher.
  • Replace direct mutations of plain props in tests with reactive() or a new object in setProps().
  • Use the built-in TeleportStub to test modals cleanly inside wrapper.

That audit takes only a few minutes, yet it closes a real server-side attack vector and keeps your component tests honest.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 7