Nunjucks autoescape bypass leads to cross site scripting
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and GitHub. Impact type from CWE-79.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Mozilla | Nunjucks | before 3.2.4 | 3.2.4 | Patch available | CNA |
| — | nunjucks (npm) | before 3.2.4 | 3.2.4 | Patch available | GHSA-x77j-w7wf-fjmw |
- Nunjucks VendorMozilla Affected before 3.2.4 Fixed in 3.2.4 Patch available CNA
- nunjucks (npm) Vendor— Affected before 3.2.4 Fixed in 3.2.4 Patch available GHSA-x77j-w7wf-fjmw
Remediation
- Fix · CNA Nunjucks (Mozilla) Fixed in 3.2.4
- Fix · GHSA-x77j-w7wf-fjmw nunjucks (npm) Fixed in 3.2.4 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
Not affected: 1 product
- Red Hat Developer Hub 1
Timeline
- 2026-10-02 Threatist record created from CVE-2023-2142
- 2026-10-03 Alias added: GHSA-x77j-w7wf-fjmw
- 2026-10-27 Affected versions changed · Red Hat
References
Advisory 2
More Mozilla Nunjucks vulnerabilities
- TI-2016-08588 Cross-site scripting in HackerOne nunjucks node module CVSS 3.0MEDIUM 6.1
Sources
- CVE-2023-2142 · CVE Program
- CVE-2023-2142 · NVD
- FIRST EPSS
- GHSA-x77j-w7wf-fjmw · GitHub Advisory Database · CC BY 4.0
- CVE-2023-2142 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences