NodeJS/nunjucks/3.1.4


A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)

https://www.npmjs.com/package/nunjucks
BSD-2-Clause

1 Security Vulnerabilities

Nunjucks autoescape bypass leads to cross site scripting

Published date: 2023-04-20T21:19:24Z
CVE: CVE-2023-2142
Links:

Impact

In Nunjucks versions prior to version 3.2.4, it was possible to bypass the restrictions which are provided by the autoescape functionality. If there are two user-controlled parameters on the same line used in the views, it was possible to inject cross site scripting payloads using the backslash \ character.

Example

If the user-controlled parameters were used in the views similar to the following: <script> let testObject = { lang: '{{ lang }}', place: '{{ place }}' }; </script>

It is possible to inject XSS payload using the below parameters: https://<application-url>/?lang=jp\&place=};alert(document.domain)//

Patches

The issue was patched in version 3.2.4.

References

Affected versions: ["0.1.3", "0.1.5", "0.1.8", "0.1.9", "1.0.0", "0.1.0-a1", "0.1.0-a3", "0.1.0-a4", "0.1.0-a6", "0.1.8-a", "1.0.1", "1.0.4", "1.0.6", "1.0.7", "1.1.0", "1.2.0", "1.3.1", "1.3.3", "2.0.0", "2.3.0", "2.4.1", "3.0.1", "3.1.2", "3.1.3", "3.1.4", "3.1.6", "3.2.2", "0.1.0", "0.1.1", "0.1.2", "0.1.4", "0.1.6", "0.1.7", "0.1.10", "0.1.0-a2", "0.1.0-a5", "0.1.0-b1", "0.1.4-a", "1.0.2", "1.0.3", "1.0.5", "1.3.0", "1.3.4", "2.1.0", "2.2.0", "2.4.0", "2.4.2", "2.4.3", "2.5.0", "2.5.1", "2.5.2", "3.0.0", "3.1.0", "3.1.7", "3.2.0", "3.2.1", "3.2.3"]
Secure versions: [3.2.4]
Recommendation: Update to version 3.2.4.

58 Other Versions

Version License Security Released
0.1.0 BSD-2-Clause 3 2012-09-19 - 17:49 almost 13 years
0.1.0-a6 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-a5 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-a4 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-a3 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-a2 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-b1 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years
0.1.0-a1 BSD-2-Clause 3 2013-12-16 - 23:11 over 11 years