Skip to content
Heist/ feed
Back to feed
Medium

Nunjucks autoescape bypass leads to cross site scripting

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-2142
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 05:46 UTC · Revision 1

Source evidence

Nunjucks autoescape bypass leads to cross site scripting

core-osv · Original source

Published 26 Nov 2024, 11:24 UTC

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.

osv:CVE-2023-2142
Complete source record
{
  "id": "9f28853d9345a7d81fd304871923bdabe2960c7405a414b655a9f2845e7cca3b",
  "url": "https://osv.dev/vulnerability/CVE-2023-2142",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Nunjucks autoescape bypass leads to cross site scripting",
    "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.",
    "evidence": "osv:CVE-2023-2142",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2023-2142",
      "aliases": [
        "CVE-2023-2142",
        "GHSA-x77j-w7wf-fjmw"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/mozilla/nunjucks",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "86a77f49da4779d55414d8337e1a4d7ec7582da5"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.2.4"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "cpe": "cpe:2.3:a:mozilla:nunjucks:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.2.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.2.3",
            "v3.2.2",
            "v3.2.1",
            "v3.2.0",
            "v3.1.7",
            "v3.1.6",
            "v3.1.5",
            "v3.1.4",
            "v3.1.3",
            "v3.1.2",
            "v3.1.1",
            "v3.1.0",
            "v3.0.1",
            "v3.0.0",
            "v2.2.0",
            "v2.1.0",
            "v2.0.0",
            "v1.3.3",
            "v1.3.2",
            "v.1.3.1",
            "v1.3.0",
            "v1.2.0",
            "v1.1.0",
            "v1.0.7",
            "v1.0.5",
            "v1.0.4",
            "v1.0.2",
            "v1.0.1",
            "v1.0.0",
            "v0.1.9",
            "v0.1.8",
            "v0.1.7",
            "v0.1.6",
            "v0.1.5",
            "v0.1.4",
            "v0.1.2",
            "v0.1.1",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-2142.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:26.376395727Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/2xxx/CVE-2023-2142.json",
        "https://github.com/mozilla/nunjucks/security/advisories/GHSA-x77j-w7wf-fjmw",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-2142",
        "https://bugzilla.mozilla.org/show_bug.cgi?id=1825980"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "mozilla",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/2xxx/CVE-2023-2142.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-2142",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 492831,
  "published_at": "2024-11-26T11:24:15.422+00:00"
}