Vulnerability GHSA-cmh5-qc8w-xvcq
Medium Risk
MEDIUM RISK
CVSS Score: 6.1
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
8 years ago
July 24, 2018 at 07:58 PM UTC
Cross-Site Scripting in i18next
>=2.0.0 <3.4.4
>=2.0.0 <3.4.4
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
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.
Related Vulnerabilities
Other vulnerabilities affecting the same packages
Medium Risk
2 hours ago
i18next deepExtend recurses into inherited built-ins, allowing corruption of shared built-in objects (DoS)
<26.3.4 GHSA-6jcc-5g8w-32mx
<26.3.4 GHSA-6jcc-5g8w-32mx
Medium Risk
8 years ago
Cross-Site Scripting in i18next
<1.10.3 GHSA-f89g-whpf-6q9m
<1.10.3 GHSA-f89g-whpf-6q9m
Impacted packages
Timeline
Published
8 years ago
July 24, 2018 at 07:58 PM UTC
Fixed (3.4.4)
Unknown
Unknown
Last Modified
3 years ago
November 08, 2023 at 03:58 AM UTC