{"id":"CVE-2023-2142","aliases":["DEBIAN-CVE-2023-2142","EUVD-2023-1422","GHSA-x77j-w7wf-fjmw","UBUNTU-CVE-2023-2142"],"status":"published","title":"Nunjucks autoescape bypass leads to cross site scripting","description":"In Nunjucks versions prior to version 3.2.4, it was \npossible to bypass the restrictions which are provided by the autoescape\n functionality. If there are two user-controlled parameters on the same \nline used in the views, it was possible to inject cross site scripting \npayloads using the backslash \\ character.","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"adp","from":"cve"},"epss":{"day":"2026-11-08","score":0.00386,"percentile":0.329,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2023-04-20T21:19:24Z","modified":"2026-10-28T02:30:26Z","fixes":[{"ecosystem":"npm","package":"nunjucks","fixed_in":["3.2.4"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:13","package":"node-nunjucks","fixed_in":["3.2.4+~cs4.2.7-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"node-nunjucks","fixed_in":["3.2.4+~cs4.2.7-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.4"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.3+dfsg+~cs1.0.1-3","3.2.4+~cs4.2.7-1","3.2.4+~cs4.2.7-2","3.2.4+~cs4.2.7-3","3.2.4+~cs4.2.7-4"]},{"source":"osv","ecosystem":"Debian:13","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.4+~cs4.2.7-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.4+~cs4.2.7-1"}]}]},{"source":"osv","ecosystem":"npm","package":"nunjucks","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.2.4"}]}]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.3+dfsg+~cs1.0.1-3"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.3+dfsg+~cs1.0.1-3","3.2.4+~cs4.2.7-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.4+~cs4.2.7-2","3.2.4+~cs4.2.7-3"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"node-nunjucks","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.2.4+~cs4.2.7-1","3.2.4+~cs4.2.7-2"]}],"products":[{"vendor":"mozilla","product":"nunjucks"}],"references":[{"url":"https://bugzilla.mozilla.org/show_bug.cgi?id=1825980","tags":["issue-tracking","Issue Tracking","Permissions Required","report","web"]},{"url":"https://github.com/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw","tags":["vendor-advisory","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/mozilla/nunjucks/pull/1437","tags":["web"]},{"url":"https://github.com/mozilla/nunjucks/commit/ec16d210e7e13f862eccdb0bc9af9f60ff6749d6","tags":["web"]},{"url":"https://github.com/mozilla/nunjucks/releases/tag/v3.2.4","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-2142","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-x77j-w7wf-fjmw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/2xxx/CVE-2023-2142.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-2142","tags":["advisory"]},{"url":"https://github.com/mozilla/nunjucks","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2023-2142","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-2142","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2023-2142","title":"Nunjucks autoescape bypass leads to cross site scripting","description":"In Nunjucks versions prior to version 3.2.4, it was \npossible to bypass the restrictions which are provided by the autoescape\n functionality. If there are two user-controlled parameters on the same \nline used in the views, it was possible to inject cross site scripting \npayloads using the backslash \\ character.","status":"published","published":"2024-11-26T11:24:15.422Z","modified":"2024-11-27T16:19:44.548Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"adp"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:35:24.004321Z"}],"euvd":[{"id":"EUVD-2023-1422","description":"In Nunjucks versions prior to version 3.2.4, it was \npossible to bypass the restrictions which are provided by the autoescape\n functionality. If there are two user-controlled parameters on the same \nline used in the views, it was possible to inject cross site scripting \npayloads using the backslash \\ character.","status":"published","published":"2024-11-26T11:24:15Z","modified":"2024-11-27T16:19:44Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T00:04:45.657538Z"}],"ghsa":[{"id":"GHSA-x77j-w7wf-fjmw","title":"Nunjucks autoescape bypass leads to cross site scripting","description":"### Impact\nIn 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.\n\n#### Example\nIf the user-controlled parameters were used in the views similar to the following:\n```\n\u003cscript\u003e\nlet testObject = { lang: '{{ lang }}', place: '{{ place }}' };\n\u003c/script\u003e\n```\n\nIt is possible to inject XSS payload using the below parameters:\n```\nhttps://\u003capplication-url\u003e/?lang=jp\\\u0026place=};alert(document.domain)//\n```\n\n### Patches\nThe issue was patched in version 3.2.4.\n\n### References\n\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1825980\n","status":"published","published":"2023-04-20T21:19:24Z","modified":"2024-11-26T18:54:29Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:38:23.575854Z"}],"nvd":[{"id":"CVE-2023-2142","description":"In Nunjucks versions prior to version 3.2.4, it was \npossible to bypass the restrictions which are provided by the autoescape\n functionality. If there are two user-controlled parameters on the same \nline used in the views, it was possible to inject cross site scripting \npayloads using the backslash \\ character.","status":"published","published":"2024-11-26T12:15:18.307Z","modified":"2026-06-17T05:51:35.577Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:09:19.052418Z"}],"osv":[{"id":"CVE-2023-2142","title":"Nunjucks autoescape bypass leads to cross site scripting","description":"In Nunjucks versions prior to version 3.2.4, it was \npossible to bypass the restrictions which are provided by the autoescape\n functionality. If there are two user-controlled parameters on the same \nline used in the views, it was possible to inject cross site scripting \npayloads using the backslash \\ character.","status":"published","published":"2024-11-26T11:24:15.422Z","modified":"2026-10-28T02:30:26.376395727Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:30.334753Z"},{"id":"DEBIAN-CVE-2023-2142","description":"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.","status":"published","published":"2024-11-26T12:15:18.307Z","modified":"2026-10-26T18:00:21.501535513Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:39.369204Z"},{"id":"GHSA-x77j-w7wf-fjmw","title":"Nunjucks autoescape bypass leads to cross site scripting","description":"### Impact\nIn 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.\n\n#### Example\nIf the user-controlled parameters were used in the views similar to the following:\n```\n\u003cscript\u003e\nlet testObject = { lang: '{{ lang }}', place: '{{ place }}' };\n\u003c/script\u003e\n```\n\nIt is possible to inject XSS payload using the below parameters:\n```\nhttps://\u003capplication-url\u003e/?lang=jp\\\u0026place=};alert(document.domain)//\n```\n\n### Patches\nThe issue was patched in version 3.2.4.\n\n### References\n\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1825980\n","status":"published","published":"2023-04-20T21:19:24Z","modified":"2024-11-26T18:54:25Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"},{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:59.484835Z"},{"id":"UBUNTU-CVE-2023-2142","description":"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.","status":"published","published":"2024-11-26T12:15:00Z","modified":"2026-10-17T12:56:00.864662899Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T16:54:18.756095Z"}]}}
