CVE-2023-2142 json
Nunjucks autoescape bypass leads to cross site scripting
published 2023-04-20 3 y ago modified 2026-06-17 4 mo ago also EUVD-2023-1422 , GHSA-x77j-w7wf-fjmw
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 32%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm nunjucks 3.2.4
- Mozilla Nunjucks 3.2.4
- node-nunjucks Debian 14, Debian 13 3.2.4+~cs4.2.7-1
debian advisories DEBIAN-CVE-2023-2142
- github.com/mozilla/nunjucks@ec16d21 commit
- github.com/mozilla/nunjucks#1437 pull request
- github.com/mozilla/nunjucks/releases/tag/v3.2.4 release
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-2142 updated cvss 5.4
Nunjucks: Nunjucks autoescape bypass leads to cross site scripting
-
Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9, rhdh-operator-containernot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 23 mo ago
Exploit prediction
0.39% chance of exploitation in the next 30 days, higher than 32% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | nunjucks | <3.2.4 |
3.2.4 |
Affected products
- Mozilla Nunjucks
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/mozilla/nunjucks/pull/1437
web
-
github.com
/mozilla/nunjucks/commit/ec16d210e7e13f862eccdb0bc9af9f60ff6749d6
web
-
github.com
/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw
vendor-advisory, web
-
bugzilla.mozilla.org
/show_bug.cgi?id=1825980
issue-tracking, web, permissions-required
-
nvd.nist.gov
/vuln/detail/CVE-2023-2142
advisory
-
github.com
/mozilla/nunjucks
package
-
github.com
/mozilla/nunjucks/releases/tag/v3.2.4
web
Sources
- CVE List CVE-2023-2142
- GitHub Advisory GHSA-x77j-w7wf-fjmw
- NVD CVE-2023-2142
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.