{"id":"CVE-2016-10547","aliases":["EUVD-2018-0746","GHSA-f7ph-p5rv-phw2"],"status":"published","title":"Cross-Site Scripting in nunjucks","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[]=\u003cscript\u003ealert(1)\u003c/script\u003e`, it is possible to bypass autoescaping and inject content into the DOM.","severity":{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-07","score":0.01418,"percentile":0.7295,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2018-05-31T20:00:00Z","modified":"2026-10-20T10:47:12Z","fixes":[{"ecosystem":"npm","package":"nunjucks","fixed_in":["2.4.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.4.3"}]}]},{"source":"osv","ecosystem":"npm","package":"nunjucks","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.4.3"}]}]}],"products":[{"vendor":"hackerone","product":"nunjucks node module"},{"vendor":"mozilla","product":"nunjucks"}],"references":[{"url":"https://github.com/mozilla/nunjucks/issues/835","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://nodesecurity.io/advisories/147","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence"]},{"url":"https://github.com/matt-/nunjucks_test","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2016-10547","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-f7ph-p5rv-phw2","tags":["advisory"]},{"url":"https://www.npmjs.com/advisories/147","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2016-10547","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[]=\u003cscript\u003ealert(1)\u003c/script\u003e`, it is possible to bypass autoescaping and inject content into the DOM.","status":"published","published":"2018-05-31T20:00:00Z","modified":"2024-09-16T16:43:50.537Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:33:31.117878Z"}],"euvd":[{"id":"EUVD-2018-0746","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[]=\u003cscript\u003ealert(1)\u003c/script\u003e`, it is possible to bypass autoescaping and inject content into the DOM.","status":"published","published":"2018-05-31T20:00:00Z","modified":"2024-09-16T16:43:50Z","updated_at":"2026-11-03T00:55:48.659023Z"}],"ghsa":[{"id":"GHSA-f7ph-p5rv-phw2","title":"Cross-Site Scripting in nunjucks","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.\n\n## Proof of Concept\n\nBy using an array for the keys in a template var, escaping is bypassed.\n```javascript\nname[]=\u003cscript\u003ealert(1)\u003c/script\u003e\n```\n\nA full PoC is available in the references section.\n\n\n## Recommendation\n\nUpdate to version 2.4.3 or later.","status":"published","published":"2018-11-06T23:13:37Z","modified":"2023-01-09T05:02:52Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:03.768255Z"}],"nvd":[{"id":"CVE-2016-10547","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[]=\u003cscript\u003ealert(1)\u003c/script\u003e`, it is possible to bypass autoescaping and inject content into the DOM.","status":"published","published":"2018-05-31T20:29:01.737Z","modified":"2026-06-17T00:39:54.89Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:03:39.176887Z"}],"osv":[{"id":"CVE-2016-10547","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[]=\u003cscript\u003ealert(1)\u003c/script\u003e`, it is possible to bypass autoescaping and inject content into the DOM.","status":"published","published":"2018-05-31T20:29:01.737Z","modified":"2026-10-20T10:47:12.454356936Z","cvss":[{"version":"3.0","score":6.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:01.531338Z"},{"id":"GHSA-f7ph-p5rv-phw2","title":"Cross-Site Scripting in nunjucks","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.\n\n## Proof of Concept\n\nBy using an array for the keys in a template var, escaping is bypassed.\n```javascript\nname[]=\u003cscript\u003ealert(1)\u003c/script\u003e\n```\n\nA full PoC is available in the references section.\n\n\n## Recommendation\n\nUpdate to version 2.4.3 or later.","status":"published","published":"2018-11-06T23:13:37Z","modified":"2023-11-08T03:58:11.826004Z","cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:46.006631Z"}]}}
