It is poss","image":"https://o3.security/opengraph.png","datePublished":"2023-04-20T21:19:24Z","dateModified":"2024-11-26T18:54:25Z","url":"https://o3.security/vulnerability/CVE-2023-2142","inLanguage":"en","author":{"@id":"https://o3.security/#organization"},"publisher":{"@id":"https://o3.security/#organization"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://o3.security/vulnerability/CVE-2023-2142"},"speakable":{"@type":"SpeakableSpecification","cssSelector":["h1",".vuln-summary",".vuln-severity",".vuln-mitigation"]},"about":[{"@type":"SoftwareApplication","name":"nunjucks","applicationCategory":"npm","softwareVersion":"3.2.4"}],"citation":[{"@type":"CreativeWork","name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-2142"},{"@type":"CreativeWork","name":"OSV.dev","url":"https://osv.dev/vulnerability/CVE-2023-2142"},{"@type":"CreativeWork","name":"FIRST.org EPSS","url":"https://www.first.org/epss/api-data?cve=CVE-2023-2142"},{"@type":"CreativeWork","url":"https://github.com/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw"},{"@type":"CreativeWork","url":"https://github.com/mozilla/nunjucks/pull/1437"},{"@type":"CreativeWork","url":"https://github.com/mozilla/nunjucks/commit/ec16d210e7e13f862eccdb0bc9af9f60ff6749d6"},{"@type":"CreativeWork","url":"https://bugzilla.mozilla.org/show_bug.cgi?id=1825980"},{"@type":"CreativeWork","url":"https://github.com/mozilla/nunjucks/releases/tag/v3.2.4"}]}It is poss","url":"https://o3.security/vulnerability/CVE-2023-2142","identifier":"CVE-2023-2142","datePublished":"2023-04-20T21:19:24Z","dateModified":"2024-11-26T18:54:25Z","inLanguage":"en","license":"https://creativecommons.org/licenses/by/4.0/","keywords":["CVE-2023-2142","MEDIUM severity","CWE-79","CVE","vulnerability","security advisory"],"creator":{"@id":"https://o3.security/#organization"},"isAccessibleForFree":true,"citation":[{"@type":"CreativeWork","name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-2142"},{"@type":"CreativeWork","name":"OSV.dev","url":"https://osv.dev/vulnerability/CVE-2023-2142"},{"@type":"CreativeWork","name":"FIRST.org EPSS","url":"https://www.first.org/epss/api-data?cve=CVE-2023-2142"}],"variableMeasured":[{"@type":"PropertyValue","name":"CVSS Base Score","value":6.1,"description":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},{"@type":"PropertyValue","name":"Severity","value":"MEDIUM"},{"@type":"PropertyValue","name":"EPSS Percentile","value":30}]}\n```\n\nIt is possible to inject XSS payload using the below parameters:\n```\nhttps://
NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

Nunjucks autoescape bypass leads to cross site scriptingGHSA-x77j-w7wf-fjmw

MEDIUMFix: mozilla/nunjucks#1437

GHSA-x77j-w7wf-fjmw is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in nunjucks. A fix is available for nunjucks — see the affected versions and patch details below.

Also known asCVE-2023-2142
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 3, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for GHSA-x77j-w7wf-fjmw.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs30th percentile — riskier than 30% of all scored CVEsHighest risk
0.00%0.29%0.58%0.86%0.2%0.4%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

3Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
nunjucksnpm
5.2Mdownloads / week

Description

Impact

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.

Example

If the user-controlled parameters were used in the views similar to the following:

<script>
let testObject = { lang: '{{ lang }}', place: '{{ place }}' };
</script>

It is possible to inject XSS payload using the below parameters:

https://<application-url>/?lang=jp\&place=};alert(document.domain)//

Patches

The issue was patched in version 3.2.4.

References

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmnunjucksall versions3.2.4npm install nunjucks@3.2.4

Affected Products

1 product · 1 configurations
Application
nunjucksmozilla
< 3.2.4
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nunjucks, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update nunjucks to 3.2.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-x77j-w7wf-fjmw is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Frequently Asked Questions

### Impact 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. #### Example If the user-controlled parameters were used in the views similar to the following: ``` <script> let testObject = { lang: '{{ lang }}', place: '{{ place }}' }; </script> ``` It is possible to inject XSS payload using the below parameters: ``` https://<application-
O3 Security · Impact-Aware SCA

Is GHSA-x77j-w7wf-fjmw in your dependencies?

Find it across npm, including transitive dependencies.

Nunjucks autoescape bypass leads to cross site scripting