Skip to content
Fencer Vulns
medium 6.1

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

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-container
    not 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

Sources

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.