i18next
Affected
- introduced
2.0.0, fixed3.4.4(semver)
Fixed versions
3.4.4
Fix
- Fixed version
3.4.4npm install [email protected]
Advisory
Also known as: CVE-2017-16010
Cross-Site Scripting in i18next
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
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:
<script>alert(1)</script> Johnson
This is supposed to be the default. However, if escapeValue is not included, the result is the unescaped string:
<script>alert(1)</script> Johnson
Recommendation
Update to version 3.4.4 or later.
Medium Basis: The source's own band: MODERATE
2.0.0, fixed 3.4.4 (semver)3.4.4
3.4.4npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0