GHSA-f89g-whpf-6q9m

Suggest an improvement
Source
https://github.com/advisories/GHSA-f89g-whpf-6q9m
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-f89g-whpf-6q9m/GHSA-f89g-whpf-6q9m.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f89g-whpf-6q9m
Aliases
Published
2018-11-09T17:46:56Z
Modified
2023-11-08T03:58:59.466803Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N CVSS Calculator
Summary
Cross-Site Scripting in i18next
Details

Affected versions of i18next allow untrusted user input to be injected into dictionary key names, resulting in a cross-site scripting vulnerability.

Proof of Concept

var init = i18n.init({debug: true}, function(){
  var test = i18n.t('__firstName__ __lastName__', {
        escapeInterpolation: true,
        firstName: '__lastNameHTML__',
        lastName: '<script>',
  });
  console.log(test);
});
// equals "<script> &lt;script&gt;"

Recommendation

Update to version 1.10.3 or later.

Database specific
{
    "github_reviewed_at": "2020-06-16T21:34:06Z",
    "cwe_ids": [
        "CWE-79"
    ],
    "nvd_published_at": null,
    "severity": "MODERATE",
    "github_reviewed": true
}
References

Affected packages

npm / i18next

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.10.3

Database specific

{
    "last_known_affected_version_range": "<= 1.10.2"
}