CVE-2017-16010: XSS
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 <script>alert(1)</script> 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.
Other sources
i18next is a language translation framework. When using the .init method, passing interpolation options without passing an escapeValue will default to undefined rather than the assumed true. This can result in a cross-site scripting vulnerability because user input is assumed to be escaped, but is not. This vulnerability affects i18next 2.0.0 and later.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2017-16010?
The severity of CVE-2017-16010 is classified as medium with a score of 6.1.
What kind of vulnerability is CVE-2017-16010?
CVE-2017-16010 is an XSS vulnerability due to improper input sanitization in the i18next library.
How do I fix CVE-2017-16010?
To fix CVE-2017-16010, ensure to set the 'escapeValue' option to true when using the .init method.
Which software versions are affected by CVE-2017-16010?
CVE-2017-16010 affects certain versions of the i18next library used in Node.js applications.
What happens if the issues in CVE-2017-16010 are exploited?
If exploited, CVE-2017-16010 could allow attackers to inject malicious scripts through unsanitized user input, leading to XSS attacks.