Vulnerabilities

2 via 2 paths

Dependencies

90

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
Status
  • 2
  • 0
  • 0

low severity

Improper Encoding or Escaping of Output

  • Vulnerable module: @intlify/core-base
  • Introduced through: vue-i18n@10.0.8

Detailed paths

  • Introduced through: wegue@meggsimum/wegue › vue-i18n@10.0.8 › @intlify/core-base@10.0.8
    Remediation: Upgrade to vue-i18n@11.4.14.

Overview

@intlify/core-base is a @intlify/core-base

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via the escapeParams function in packages/core-base/src/translate.ts, when a translation call passes both list and named interpolation values simultaneously. The original logic used else if to escape named values, meaning that when a list argument is also present, named values are never passed through escapeHtml. An attacker who controls a named interpolation value can inject unescaped HTML into the rendered output, enabling a cross-site scripting attack.

Note: This is only exploitable when the escapeParameter option is explicitly set to true.

PoC

import { createI18n } from 'vue-i18n'

const i18n = createI18n({
  legacy: false,
  locale: 'en',
  escapeParameter: true,
  messages: {
    en: { withList: '{0} {name}', withoutList: '{name}' }
  }
})
const t = i18n.global.t

t('withoutList', { name: '<b>x</b>' })
// &lt;b&gt;x&lt;&#x2F;b&gt;      escaped

t('withList', ['a'], { named: { name: '<b>x</b>' } })
// a <b>x</b>                   not escaped (v11.4.13)

Note: The PoC uses vue-i18n with escapeParameter: true and demonstrates that named values are not escaped when a list argument is also passed.

Remediation

Upgrade @intlify/core-base to version 12.0.0-alpha.5, 11.4.14 or higher.

References

low severity

Improper Encoding or Escaping of Output

  • Vulnerable module: vue-i18n
  • Introduced through: vue-i18n@10.0.8

Detailed paths

  • Introduced through: wegue@meggsimum/wegue › vue-i18n@10.0.8
    Remediation: Upgrade to vue-i18n@11.4.14.

Overview

vue-i18n is an Internationalization plugin for Vue.js

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via the escapeParams function in packages/core-base/src/translate.ts, when a translation call passes both list and named interpolation values simultaneously. The original logic used else if to escape named values, meaning that when a list argument is also present, named values are never passed through escapeHtml. An attacker who controls a named interpolation value can inject unescaped HTML into the rendered output, enabling a cross-site scripting attack.

Note: This is only exploitable when the escapeParameter option is explicitly set to true.

PoC

import { createI18n } from 'vue-i18n'

const i18n = createI18n({
  legacy: false,
  locale: 'en',
  escapeParameter: true,
  messages: {
    en: { withList: '{0} {name}', withoutList: '{name}' }
  }
})
const t = i18n.global.t

t('withoutList', { name: '<b>x</b>' })
// &lt;b&gt;x&lt;&#x2F;b&gt;      escaped

t('withList', ['a'], { named: { name: '<b>x</b>' } })
// a <b>x</b>                   not escaped (v11.4.13)

Note: The PoC uses vue-i18n with escapeParameter: true and demonstrates that named values are not escaped when a list argument is also passed.

Remediation

Upgrade vue-i18n to version 12.0.0-alpha.5, 11.4.14 or higher.

References