Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. nunjucks
  4. ›
  5. CVE-2023-2142

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

April 20, 2023 (updated November 26, 2024)

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.

References

  • bugzilla.mozilla.org/show_bug.cgi?id=1825980
  • github.com/advisories/GHSA-x77j-w7wf-fjmw
  • github.com/mozilla/nunjucks
  • github.com/mozilla/nunjucks/commit/ec16d210e7e13f862eccdb0bc9af9f60ff6749d6
  • github.com/mozilla/nunjucks/pull/1437
  • github.com/mozilla/nunjucks/releases/tag/v3.2.4
  • github.com/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw
  • nvd.nist.gov/vuln/detail/CVE-2023-2142

Code Behaviors & Features

Detect and mitigate CVE-2023-2142 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.2.4

Fixed versions

  • 3.2.4

Solution

Upgrade to version 3.2.4 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/nunjucks/CVE-2023-2142.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:58 +0000.