Skip to content

Cross-Site Scripting in nunjucks

Moderate severity GitHub Reviewed Published Nov 6, 2018 to the GitHub Advisory Database • Updated Jan 9, 2023

Package

npm nunjucks (npm)

Affected versions

< 2.4.3

Patched versions

2.4.3

Description

Affected versions of nunjucks do not properly escape specially structured user input in template vars when in auto-escape mode, resulting in a cross-site scripting vulnerability.

Proof of Concept

By using an array for the keys in a template var, escaping is bypassed.

name[]=<script>alert(1)</script>

A full PoC is available in the references section.

Recommendation

Update to version 2.4.3 or later.

References

Published to the GitHub Advisory Database Nov 6, 2018
Reviewed Jun 16, 2020
Last updated Jan 9, 2023

Severity

Moderate

EPSS score

0.159%
(53rd percentile)

Weaknesses

CVE ID

CVE-2016-10547

GHSA ID

GHSA-f7ph-p5rv-phw2

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.