CVE-2016-10547 Cross-Site Scripting in nunjucks
Attackers can bypass autoescaping in Nunjucks templates to inject malicious scripts into the DOM, potentially executing arbitrary code in user browsers.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2016-10547?
CVE-2016-10547 is a medium-severity cross-site scripting vulnerability in HackerOne nunjucks node module, published on 31 May 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Nunjucks is a full featured templating engine for JavaScript. Versions 2.4.2 and lower have a cross site scripting (XSS) vulnerability in autoescape mode. In autoescape mode, all template vars should automatically be escaped. By using an array for the keys, such as `name[]=<script>alert(1)</script>`, it is possible to bypass autoescaping and inject content into the DOM.
Weakness: CWE-79
Which versions are affected by CVE-2016-10547?
2 open source packages ship an affected version, including nunjucks. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
nunjucks npm | All versions | 2.4.3 |
nunjucks npm | All versions | 2.4.3 |
Products include Mozilla Nunjucks.
How do I fix CVE-2016-10547?
Upgrade nunjucks to 2.4.3 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2016-10547 being exploited?
There is no known exploitation of CVE-2016-10547 in the wild and no public exploit code.
Other vulnerabilities in HackerOne nunjucks node module
Sources
Also known as GHSA-f7ph-p5rv-phw2.