{"id":"GHSA-7356-3q55-jvxm","summary":"Vue I18n: sanitizeTranslatedHtml allows DOM XSS via javascript: URLs after an unquoted attribute value that contains a quote","details":"### Summary\n\nWhen `escapeParameter` is enabled (`escapeParameterHtml` in the Legacy API), Vue I18n passes the translated string through `sanitizeTranslatedHtml()`. The sanitizer replaces `javascript:` URLs in `href`, `xlink:href`, `src`, `action` and `formaction` with `about:blank`.\n\nIt finds attributes with regular expressions, not with an HTML tokenizer. The two disagree when an **unquoted** attribute value contains a quote character. HTML allows that: `x=y\"z=\"q` is one attribute, `x`, with the value `y\"z=\"q`. The sanitizer instead reads `z=\"q href=\"` as a quoted attribute named `z`, and so it consumes the opening quote of the real `href`. The real `href=\"javascript:...\"` is then never inspected:\n\n```html\n\u003ciframe x=y\"z=\"q src=\"javascript:alert(document.domain)\"\u003e\u003c/iframe\u003e\n\u003ca x=y\"z=\"q href=\"javascript:alert(document.domain)\"\u003eclick\u003c/a\u003e\n```\n\nBoth strings come out of `sanitizeTranslatedHtml()` unchanged, and the browser parses them with `src` / `href` set to the `javascript:` URL. This bypasses the `javascript:` URL check that the sanitizer has had since the fix for CVE-2025-53892 (GHSA-x8qp-wqqm-57ph), as GHSA-83rm-6c8r-g728 (`srcdoc`) and GHSA-473g-cvf6-mfxj (SVG links) did.\n\nChecked on `packages/shared/src/sanitize.ts` at `master` (last change `a66ace0a`, 2026-11-03), which is v11.4.18, the latest release.\n\n### Details\n\n`sanitizeTranslatedHtml()` in `packages/shared/src/sanitize.ts` (v11.4.18) works in these steps:\n\n1. Quoted attributes, double quotes and then single quotes:\n   ```ts\n   html = html.replace(/([\\w:-]+)\\s*=\\s*\"([^\"]*)\"/g, (_, attrName, attrValue) =\u003e `${attrName}=\"${sanitizeAttributeValue(attrName, attrValue)}\"`)\n   html = html.replace(/([\\w:-]+)\\s*=\\s*'([^']*)'/g, ...)\n   ```\n   `sanitizeAttributeValue` applies the `javascript:` check only when `attrName` is a URL attribute.\n2. Event handlers, `srcdoc` and `\u003cbase|animate|set|script\u003e` are neutralized with global patterns.\n3. Unquoted URL attributes:\n   ```ts\n   const unquotedUrlAttributePattern = /(^|[\\s\"'\u003c\u003e/])((?:href|xlink:href|src|action|formaction)\\s*=\\s*)([^\\s\"'=\u003c\u003e`]+)/gi\n   ```\n\nFor the input `\u003ca x=y\"z=\"q href=\"javascript:alert(1)\"\u003e`:\n\n- Step 1 scans left to right for `name=\"...\"`. `x=y` is not followed by a quote. The first match is `z=\"q href=\"`: name `z`, value `q href=`. `z` is not a URL attribute and the value needs no escaping, so nothing changes. The scan resumes **after** that closing quote, at `javascript:alert(1)\"\u003e`, where no `name=\"...\"` follows.\n- Step 3 finds `href=`, but the value class `[^\\s\"'=\u003c\u003e`]+` cannot start with `\"`, so there is no match.\n- The steps for event handlers, `srcdoc` and dangerous elements do not apply.\n\nThe browser reads the same tag as two attributes. In the HTML tokenizer's \"attribute value (unquoted)\" state, `\"` is a parse error but it is kept in the value:\n\n```text\nx    = y\"z=\"q\nhref = javascript:alert(1)\n```\n\nThe single-quote form `\u003ca x=y'z='q href='javascript:alert(1)'\u003e` desynchronizes the second expression in the same way.\n\nEvent handlers are not reachable with this trick, because their pattern is global and does not depend on quoting. The bypass is limited to `javascript:` URLs.\n\n### Suggested fix\n\n- Tokenize start tags the way HTML does (attribute name, then an unquoted, single-quoted or double-quoted value) and run the URL, event-handler and `srcdoc` checks on every attribute the tokenizer returns. Regular expressions over the whole string cannot agree with the parser on where an attribute starts.\n- A smaller hardening that closes this case: in the unquoted pass, let the value of a URL attribute start with a quote (strip one leading quote before `hasJavascriptScheme`), or add a pass that checks `(?:href|xlink:href|src|action|formaction)\\s*=\\s*[\"']?\u003cvalue\u003e` everywhere, regardless of what steps 1 and 2 matched.\n- Add the three strings from the proof of concept as test cases.\n\n### Proof of concept\n\n**1. The sanitizer leaves the strings unchanged.** I re-typed the patterns of `sanitize.ts` into a stand-alone script (no package loaded) and printed input and output. Output of my run:\n\n```text\ncontrol: quoted href           | \u003ca href=\"javascript:alert(1)\"\u003ex\u003c/a\u003e\n                                -\u003e \u003ca href=\"about:blank\"\u003ex\u003c/a\u003e\ncontrol: unquoted src          | \u003ciframe src=javascript:alert(1)\u003e\n                                -\u003e \u003ciframe src=about:blank\u003e\ncontrol: entity-obfuscated     | \u003ca href=\"jav&#x09;ascript&colon;alert(1)\"\u003ex\u003c/a\u003e\n                                -\u003e \u003ca href=\"about:blank\"\u003ex\u003c/a\u003e\ncandidate A (a href)           | \u003ca x=y\"z=\"q href=\"javascript:alert(1)\"\u003ex\u003c/a\u003e\n                                -\u003e \u003ca x=y\"z=\"q href=\"javascript:alert(1)\"\u003ex\u003c/a\u003e\ncandidate B (iframe src)       | \u003ciframe x=y\"z=\"q src=\"javascript:alert(1)\"\u003e\u003c/iframe\u003e\n                                -\u003e \u003ciframe x=y\"z=\"q src=\"javascript:alert(1)\"\u003e\u003c/iframe\u003e\ncandidate C (single quotes)    | \u003ca x=y'z='q href='javascript:alert(1)'\u003ex\u003c/a\u003e\n                                -\u003e \u003ca x=y'z='q href='javascript:alert(1)'\u003ex\u003c/a\u003e\n```\n\n**2. The browser parses them as `javascript:` URLs.** `new DOMParser().parseFromString(html, 'text/html')` in Chrome, attributes of the first element:\n\n```text\nA       x = y\"z=\"q    href = javascript:alert(1)\nIFRAME  x = y\"z=\"q    src  = javascript:alert(1)\nA       x = y'z='q    href = javascript:alert(1)\n```\n\n**3. In an application.** I did not run this step with the published package; it is the setup used in the earlier sanitizer advisories:\n\n```js\nimport { createI18n } from 'vue-i18n'\n\nconst i18n = createI18n({\n  legacy: false,\n  locale: 'en',\n  escapeParameter: true,\n  messages: {\n    en: { banner: '\u003ciframe x=y\"z=\"q src=\"javascript:alert(document.domain)\"\u003e\u003c/iframe\u003e' }\n  }\n})\n// template: \u003cp v-html=\"$t('banner')\"\u003e\u003c/p\u003e\n```\n\n### Impact\n\nDOM XSS in the origin of the application for anyone who relies on `escapeParameter` / `sanitizeTranslatedHtml` to neutralize active content in translation messages that are rendered with `v-html` (or on the server), when the message markup can be influenced by an attacker: translations loaded from a CMS, a translation platform, user-contributed locales, and similar.\n\nA parameter alone cannot trigger it: parameters are escaped by `escapeHtml`, which turns quotes and `=` into character references. The precondition is the same as \"markup in a message\" in GHSA-83rm-6c8r-g728 and GHSA-473g-cvf6-mfxj.\n\nSeverity: for the `\u003ciframe src\u003e` form, which needs no interaction, I used the vector of GHSA-83rm-6c8r-g728: CVSS 3.1 `AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N` (7.2). The `\u003ca href\u003e` form needs a click (`UI:R`, 6.1).\n\nAffected packages share the sanitizer: `vue-i18n`, `petite-vue-i18n`, `@intlify/core`, `@intlify/core-base`, `@intlify/vue-i18n-core`, `@intlify/shared`.\n\nCWE-79 (Cross-site Scripting).\n\nI found no existing advisory or issue for this case. The published sanitizer advisories cover event handlers (GHSA-x8qp-wqqm-57ph), `srcdoc` (GHSA-83rm-6c8r-g728), SVG links (GHSA-473g-cvf6-mfxj) and `\u003cscript\u003e` under SSR (GHSA-jrxq-gc2q-9357).\n\nPrepared with AI assistance.\n\n### Patches\n\nFixed in `vue-i18n` 11.4.19 and 12.0.0-alpha.10, and in the same versions of `petite-vue-i18n`, `@intlify/core-base`, `@intlify/core`, `@intlify/vue-i18n-core` and `@intlify/shared`.\n\n`sanitizeTranslatedHtml()` now reads tags and attributes with the rules of the HTML tokenizer, so that it agrees with browsers on where each attribute starts and ends, and it checks every attribute of every start tag. A tag, a comment, or an element like `\u003ctextarea\u003e` that is not closed at the end of a translation is turned into text, so that it cannot take in the rest of the page when the HTML is rendered on the server.\n\nv9 and v10 are not supported, and do not get a fix.\n\n### Workarounds\n\nDo not render translation messages from untrusted sources with `v-html`, even with `escapeParameter` enabled. Use [Component interpolation](https://vue-i18n.intlify.dev/guide/advanced/component.html) instead.\n\n### Related\n\n- [GHSA-9qc3-h48f-7h96](https://github.com/intlify/vue-i18n/security/advisories/GHSA-9qc3-h48f-7h96), which is fixed by the same change\n- [HTML Message - Using the escape parameter option](https://vue-i18n.intlify.dev/guide/essentials/syntax.html#using-the-escape-parameter-option)","aliases":["CVE-2026-144407"],"modified":"2026-12-05T18:45:16.780073432Z","published":"2026-12-04T22:13:17Z","database_specific":{"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-12-04T22:13:17Z","nvd_published_at":"2026-12-03T20:17:47Z","cwe_ids":["CWE-79"]},"references":[{"type":"WEB","url":"https://github.com/intlify/vue-i18n/security/advisories/GHSA-7356-3q55-jvxm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-144407"},{"type":"WEB","url":"https://github.com/intlify/vue-i18n/pull/2769"},{"type":"WEB","url":"https://github.com/intlify/vue-i18n/commit/addbc3aa1bebb5542541c4ef08968e2cd0ea2d71"},{"type":"WEB","url":"https://github.com/intlify/vue-i18n/commit/ef52989d0dde9e12fa3c7fc25494b306f7f05d93"},{"type":"PACKAGE","url":"https://github.com/intlify/vue-i18n"},{"type":"WEB","url":"https://github.com/intlify/vue-i18n/releases/tag/v11.4.19"},{"type":"WEB","url":"https://github.com/intlify/vue-i18n/releases/tag/v12.0.0-alpha.10"}],"affected":[{"package":{"name":"vue-i18n","ecosystem":"npm","purl":"pkg:npm/vue-i18n"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"vue-i18n","ecosystem":"npm","purl":"pkg:npm/vue-i18n"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"vue-i18n","ecosystem":"npm","purl":"pkg:npm/vue-i18n"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"vue-i18n","ecosystem":"npm","purl":"pkg:npm/vue-i18n"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"petite-vue-i18n","ecosystem":"npm","purl":"pkg:npm/petite-vue-i18n"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"petite-vue-i18n","ecosystem":"npm","purl":"pkg:npm/petite-vue-i18n"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"petite-vue-i18n","ecosystem":"npm","purl":"pkg:npm/petite-vue-i18n"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"petite-vue-i18n","ecosystem":"npm","purl":"pkg:npm/petite-vue-i18n"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core-base","ecosystem":"npm","purl":"pkg:npm/%40intlify/core-base"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core-base","ecosystem":"npm","purl":"pkg:npm/%40intlify/core-base"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core-base","ecosystem":"npm","purl":"pkg:npm/%40intlify/core-base"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core-base","ecosystem":"npm","purl":"pkg:npm/%40intlify/core-base"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core","ecosystem":"npm","purl":"pkg:npm/%40intlify/core"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core","ecosystem":"npm","purl":"pkg:npm/%40intlify/core"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core","ecosystem":"npm","purl":"pkg:npm/%40intlify/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/core","ecosystem":"npm","purl":"pkg:npm/%40intlify/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/vue-i18n-core","ecosystem":"npm","purl":"pkg:npm/%40intlify/vue-i18n-core"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/vue-i18n-core","ecosystem":"npm","purl":"pkg:npm/%40intlify/vue-i18n-core"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/vue-i18n-core","ecosystem":"npm","purl":"pkg:npm/%40intlify/vue-i18n-core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/vue-i18n-core","ecosystem":"npm","purl":"pkg:npm/%40intlify/vue-i18n-core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/shared","ecosystem":"npm","purl":"pkg:npm/%40intlify/shared"},"versions":["9.14.5"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/shared","ecosystem":"npm","purl":"pkg:npm/%40intlify/shared"},"versions":["10.0.8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/shared","ecosystem":"npm","purl":"pkg:npm/%40intlify/shared"},"ranges":[{"type":"SEMVER","events":[{"introduced":"11.1.10"},{"fixed":"11.4.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}},{"package":{"name":"@intlify/shared","ecosystem":"npm","purl":"pkg:npm/%40intlify/shared"},"ranges":[{"type":"SEMVER","events":[{"introduced":"12.0.0-alpha.4"},{"fixed":"12.0.0-alpha.10"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-7356-3q55-jvxm/GHSA-7356-3q55-jvxm.json"}}],"schema_version":"1.9.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"}]}