# CVE-2023-2142: Nunjucks autoescape bypass leads to cross site scripting

- Severity: Medium 6.1 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.39%, higher than 34% of CVEs (2026-12-02)
- Published: 2023-04-20T21:19:24.000Z
- Modified: 2026-06-17T05:51:35.577Z
- Also known as: GHSA-x77j-w7wf-fjmw
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: mozilla

## 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.

(As written by CVE List.)

## Affected

- Mozilla Nunjucks: before 3.2.4
- nunjucks (npm): before 3.2.4

## Every score

- CISA-ADP: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `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`

## References

- <https://bugzilla.mozilla.org/show_bug.cgi?id=1825980> (issue-tracking, permissions-required, web)
- <https://github.com/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-2142> (advisory)
- <https://github.com/mozilla/nunjucks/pull/1437> (web)
- <https://github.com/mozilla/nunjucks/commit/ec16d210e7e13f862eccdb0bc9af9f60ff6749d6> (web)
- <https://github.com/mozilla/nunjucks> (package)
- <https://github.com/mozilla/nunjucks/releases/tag/v3.2.4> (web)

## Sources

- CVE List: [CVE-2023-2142](https://www.cve.org/CVERecord?id=CVE-2023-2142), CVE Terms of Use, modified 2024-11-27
- GitHub Advisory Database: [GHSA-x77j-w7wf-fjmw](https://github.com/advisories/GHSA-x77j-w7wf-fjmw), CC-BY-4.0, modified 2024-11-26
- NVD: [CVE-2023-2142](https://nvd.nist.gov/vuln/detail/CVE-2023-2142), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-2142 · Whole record: https://cve.day/CVE-2023-2142.json · Rebuilt by cve.day 2026-11-25T22:58:34.387Z
