GHSA-cmh5-qc8w-xvcq

    Dashboard / Vulnerabilities / GHSA-cmh5-qc8w-xvcq

    GHSA-cmh5-qc8w-xvcq

    Published: 24 Jul 2018Last Modified: 8 Nov 2023

    Summary: Cross-Site Scripting in i18next

    Details: Affected versions of `i18next` may fail to sanitize user input when certain configuration options are used. When using the `.init` method, passing interpolation options without passing an `escapeValue` will default to `undefined` rather than the assumed `true`. ## Proof of Concept ```js var init = i18n.init({ interpolation: { prefix: "__", suffix: "__", escapeValue: true } }, function(){ var test = i18n.t('__firstName__ __lastName__', { firstName: 'Bob', lastName: '["foo","bar"]', }); console.log(test); }); ``` When `escapeValue` is explicitly passed, the result of `test` is: ```html &lt;script&gt;alert(1)&lt;&#x2F;script&gt; Johnson ``` This is supposed to be the default. However, if `escapeValue` is not included, the result is the unescaped string: ```html <script>alert(1)</script> Johnson ``` ## Recommendation Update to version 3.4.4 or later.

    Affected packages

    Package

    Name: i18next

    Purl: pkg:npm/i18next

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 2.0.0
    Fixed -3.4.4

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High