
PEACH
Un cadre d’isolation des locataires
When escapeParameter is enabled (escapeParameterHtml in the Legacy API), Vue I18n escapes the interpolation parameters before it formats a message, but only the parameters that are strings. A parameter that is an array, a plain object, or another object with its own toString() is turned into text later, with JSON.stringify() or String(), and that text is not escaped. When the translation is rendered with v-html, markup in such a value becomes a part of the page.
This is a gap in the same function as GHSA-8rc2-428q-7ww3.
escapeParams() in packages/core-base/src/translate.ts escapes a list item or a named value only when isString(value) is true. The other values are interpolated by toDisplayString(), which uses JSON.stringify() for arrays and plain objects and String() for other values, and does not escape the result.
sanitizeTranslatedHtml() still runs on the final string, so script elements, event handler attributes and javascript: URLs are neutralized. But forms, links, images, iframes and <meta http-equiv="refresh"> from such a value stay in the page.
An attacker does not need the application to pass an array on purpose. For example, route.query of Vue Router returns an array when a key appears twice in the URL (?name=a&name=b). An application that passes route.query.name as a parameter, expecting a string, gets an array from a crafted link, and the value is no longer escaped.
import { createI18n } from 'vue-i18n'
const i18n = createI18n({
legacy: false,
locale: 'en',
escapeParameter: true,
messages: { en: { hello: 'Hello {name}' } }
})
console.log(i18n.global.t('hello', { name: '<b>x</b>' }))
// Hello <b>x</b>
console.log(i18n.global.t('hello', { name: ['<b>x</b>'] }))
// v11.4.20: Hello [\n "<b>x</b>"\n]Applications are affected when they enable escapeParameter, render translations as HTML (for example with v-html), and pass a value from an untrusted source that can be something other than a string, such as route.query of Vue Router, parsed JSON, or a query string parser that makes arrays or objects.
An attacker can then add markup to the page: a form that sends what the user types to another site, links, images and iframes that load from another site, and a <meta http-equiv="refresh"> that moves the page to another site without any user interaction. Script does not run, because the sanitizer still applies.
Rendering through <i18n-t> is not affected, since it does not render translations as HTML.
Fixed in 11.4.21 and 12.0.0-alpha.12. With escapeParameter, a parameter that is not a string is now escaped after it is turned into text, in the same way as a string parameter.
Message functions still receive the parameters as they are passed. A message function that puts a parameter that is not a string into its result should escape it.
v9 and v10 are no longer supported and will not be fixed. Please migrate to v11.
escapeParameter is enabled, for example String(value), and check the type of values that come from the URL or other untrusted sources.v-html. Use component interpolation (<i18n-t>) instead.Source: NVD
Évaluation gratuite des vulnérabilités
Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.
Obtenez une démo personnalisée
"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."