CVE-2026-144406
Vue I18n: escapeParameter sanitizer leaves elements open, so a translation can change how the rest of an SSR page is parsed
Description
Summary
When escapeParameter is enabled (escapeParameterHtml in the Legacy API), Vue I18n sanitizes the translated HTML with sanitizeTranslatedHtml(). The sanitizer reads tags in the same way as the HTML tokenizer, but it does not follow how elements open and close. An element that a translation leaves open, or an end tag that closes an element outside the translation, stays in the result.
When the page is rendered on the server (SSR), the rest of the page follows the translation in the same HTML, and the browser parses it as a part of what is still open. An unclosed <template> hides the rest of the page, and an unclosed <select> takes it in. With <object><svg>, <table><svg> or <math><mi><svg>, the rest of the page is parsed as SVG, and a later inline <script> becomes an SVG script, whose character references are decoded before it runs. Text that the page puts in such a script as data, such as " in a serialized state, can then end a JavaScript string, and run in the origin of the application.
Details
sanitizeTranslatedHtml() in packages/shared/src/sanitize.ts turns a tag, a comment, or an element whose content is text (such as <textarea>) into text when it is not closed at the end of the translation (GHSA-9qc3-h48f-7h96). Other elements are kept even when they are not closed, and end tags are kept even when they close no element of the translation.
In the HTML parser, an end tag closes an element only when the element is in scope. <object>, <table>, <template>, MathML <mi> and similar elements are boundaries of the scope, so the end tags of the element that holds the translation, and of the application after it, are ignored while they are open. <svg> inside them keeps the rest of the page in SVG until a start tag such as <div>, <p> or <span> leaves SVG.
Some shapes need no boundary:
- In a
<span>,<a>,<small>or similar element,<div><svg>or<li><svg>keeps<svg>open, because the end tag of the container is ignored while a special element such as<div>is open. - In an
<a>,</a><svg>closes the container, and opens<svg>after it. - In an SVG
<foreignObject>of the page,</span></foreignObject>closes the<foreignObject>of the page without opening any element.
An inline <script> in SVG is an SVG script. Its content is parsed as markup, so " becomes " before the script runs.
Before 11.4.21 and 12.0.0-alpha.12, such markup can also come from an interpolation parameter that is not a string, even when the messages are trusted (GHSA-4fx6-3h3f-fh66).
Rendering on the client (v-html, which uses innerHTML) is not affected: the browser parses the translation as a fragment, and closes what is open at its end.
PoC
import { createI18n } from 'vue-i18n'
const i18n = createI18n({
legacy: false,
locale: 'en',
escapeParameter: true,
messages: {
en: {
footer: '© Example<object><svg>',
greeting: 'Say "-alert(document.cookie)-" hi'
}
}
})
The footer is rendered on the server with <small v-html="t('footer')"></small>, and the page puts its translations into an inline state after the application:
<footer><small>© Example<object><svg></small></footer>
<script>window.__STATE__ = {"greeting":"Say "-alert(document.cookie)-" hi"}</script>
</small> and </footer> are ignored while <object> is open, so the <script> is parsed as an SVG script, " becomes ", and alert(document.cookie) runs in the origin of the application. This was confirmed on Chromium, Chrome and WebKit with 11.4.20 and 12.0.0-alpha.11.
Impact
Applications are affected when they render translations as HTML on the server (SSR, including SSG and prerendering) with escapeParameter enabled, and an attacker can change the translations (for example crowdsourced or stored translations), or, before 11.4.21 and 12.0.0-alpha.12, pass a parameter that is not a string.
When an inline script after the translation holds text that the attacker can change (for example the translations in a serialized state), and no element that leaves SVG (such as <div>, <p> or <span>) comes between them, the attacker can run script in the origin of the application. Otherwise, the attacker can still hide the rest of the page (<template>), take it into a <select> or an <object>, or make the inputs of a later form belong to a form that the translation opened (<form action>).
Pages rendered only on the client are not affected.
Patches
Fixed in 11.4.22 and 12.0.0-alpha.13. sanitizeTranslatedHtml() now follows how browsers open and close elements, including SVG and MathML: an end tag that closes no element of the translation is removed, the elements inside an element that an end tag closes are closed before it, and the elements that are still open at the end of the translation are closed. A <form> that the translation does not close is turned into text, and so are <foreignObject>, <desc>, <mi> and similar SVG and MathML elements outside SVG and MathML.
Well-formed translations are not changed.
v9 and v10 are no longer supported and will not be fixed. Please migrate to v11.
Workarounds
- Close every element in translations that are rendered with
v-html, and do not accept translations from untrusted sources. - Do not render translations from untrusted sources with
v-htmlon the server. Use component interpolation (<i18n-t>) instead.
Related
- GHSA-9qc3-h48f-7h96: an earlier gap in the same function for pages rendered on the server (unclosed tags)
- GHSA-4fx6-3h3f-fh66: another way to put markup into a translation, before 11.4.21 and 12.0.0-alpha.12
Affected Maven artifacts (6)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » vue-i18nvia npm vue-i18n | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
| org.mvnpm.at.intlify » core-basevia npm @intlify/core-base | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
| org.mvnpm.at.intlify » sharedvia npm @intlify/shared | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
| org.webjars.npm » intlify__core-basevia npm @intlify/core-base | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
| org.webjars.npm » intlify__sharedvia npm @intlify/shared | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
| org.webjars.npm » vue-i18nvia npm vue-i18n | >= 11.1.10, < 11.4.22>= 12.0.0-alpha.4, < 12.0.0-alpha.13 | 11.4.22, 12.0.0-alpha.13 |
Blast radius
100% of the dependent artifacts (115) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 318 |
| 2 hops | 445 |
| 3 hops | 1,310 |
| 4 hops | 4,308 |
| 5 hops | 5,490 |
| 6 hops | 1,873 |
Most used dependents
- org.xwiki.platform » xwiki-platform-test-docker104 usages
- org.xwiki.platform » xwiki-platform-panels-ui62 usages
- org.xwiki.platform » xwiki-platform-appwithinminutes-ui31 usages
- org.xwiki.platform » xwiki-platform-livedata-macro27 usages
- org.xwiki.platform » xwiki-platform-mail-ui19 usages
- org.webjars.npm » vue-i18n19 usages
- org.xwiki.platform » xwiki-platform-index-ui16 usages
- org.xwiki.platform » xwiki-platform-user-profile-ui14 usages
- org.xwiki.platform » xwiki-platform-notifications-ui13 usages
- org.xwiki.platform » xwiki-platform-xclass-ui13 usages
- org.xwiki.platform » xwiki-platform-dashboard-ui12 usages
- org.xwiki.platform » xwiki-platform-flamingo-skin-resources11 usages
- org.xwiki.platform » xwiki-platform-ckeditor-test-pageobjects10 usages
- org.xwiki.platform » xwiki-platform-tag-ui10 usages
- org.xwiki.platform » xwiki-platform-search-test-utils10 usages
Computed from the dependency graph of build 20261205.0236 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (6 packages) . See all on OSV
References
| Advisory | NVD CVE-2026-144406 | nvd.nist.gov |
| Package | intlify/vue-i18n | github.com |
| Web | intlify/vue-i18n advisory GHSA-786j-gfwp-vhm5 | github.com |
| Web | intlify/vue-i18n pull request #2793 | github.com |
| Web | intlify/vue-i18n commit 813da5e | github.com |
| Web | intlify/vue-i18n commit a3b3d0a | github.com |
| Web | intlify/vue-i18n release v11.4.22 | github.com |
| Web | intlify/vue-i18n release v12.0.0-alpha.13 | github.com |
