petite-vue-i18n@12.0.0-alpha.7

Vue I18n lite version

  • latest version

    11.4.25

  • latest non vulnerable version

  • first published

    5 years ago

  • latest version published

    3 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the petite-vue-i18n package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Cross-site Scripting (XSS)

    petite-vue-i18n is a Vue I18n lite version

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via sanitizeTranslatedHtml() in packages/shared/src/sanitize.ts, which fails to neutralize javascript: URLs in unterminated attribute values. When escapeParameter (or escapeParameterHtml in the Legacy API) is enabled, the sanitizer's quoted-attribute regex requires a closing quote inside the message, and the unquoted-attribute regex rejects any value beginning with a quote character. A translation message that opens an attribute value without closing it therefore passes through with its javascript: URL intact. In server-side rendering, the HTML tokenizer continues reading across the message boundary and closes the unterminated attribute at the next " in the surrounding page markup, causing the browser to emit an <iframe> or <a> element with an attacker-controlled javascript: URL as its src or href. An <iframe src="javascript:..."> executes without any user interaction in the application's origin, giving an attacker who controls translation content stored XSS against every visitor of the affected page.

    Note: This is only exploitable when escapeParameter is enabled, translations are rendered as HTML on the server (via v-html/innerHTML in SSR, Nuxt, or pre-rendered pages), and the translation messages are not fully trusted (e.g. crowdsourced or externally stored).

    How to fix Cross-site Scripting (XSS)?

    Upgrade petite-vue-i18n to version 11.4.19, 12.0.0-alpha.10 or higher.

    <11.4.19>=12.0.0-alpha.4 <12.0.0-alpha.10