# CVE-2022-22818: Cross-site Scripting in Django

- Severity: Medium 6.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.55%, higher than 89% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-02-03T00:00:00.000Z
- Modified: 2026-09-08T08:46:25.522Z
- Also known as: GHSA-95rw-fx8r-36v6, BIT-DJANGO-2022-22818, PYSEC-2022-19
- Weaknesses: CWE-79
- Assigned by: mitre

## Description

The {% debug %} template tag in Django 2.2 before 2.2.27, 3.2 before 3.2.12, and 4.0 before 4.0.2 does not properly encode the current context. This may lead to XSS.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- django (PyPI): from 2.2 before 2.2.27; from 3.2 before 3.2.12; from 4.0 before 4.0.2
- djangoproject django: from 2.2 before 2.2.27; from 3.2 before 3.2.12; from 4.0 before 4.0.2
- fedoraproject fedora: 35
- debian debian_linux: 11.0
- django (Bitnami): from 2.2.0 before 2.2.27; from 3.2.0 before 3.2.12; from 4.0.0 before 4.0.2

## Every score

- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://www.djangoproject.com/weblog/2022/feb/01/security-releases/> (exploit, advisory, article, patch, third-party-advisory)
- <https://groups.google.com/forum/#%21forum/django-announce> (web)
- <https://docs.djangoproject.com/en/4.0/releases/security/> (advisory, patch, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV/> (vendor-advisory, web)
- <https://security.netapp.com/advisory/ntap-20220221-0003/> (advisory, third-party-advisory)
- <https://www.debian.org/security/2022/dsa-5254> (advisory, third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-22818> (advisory, web)
- <https://github.com/django/django/commit/01422046065d2b51f8f613409cad2c81b39487e5> (web)
- <https://github.com/django/django/commit/1a1e8278c46418bde24c86a65443b0674bae65e2> (web)
- <https://github.com/django/django/commit/c27a7eb9f40b64990398978152e62b6ff839c2e6> (web)
- <https://docs.djangoproject.com/en/4.0/releases/security> (web)
- <https://github.com/advisories/GHSA-95rw-fx8r-36v6> (advisory)
- <https://github.com/django/django> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-19.yaml> (web)
- <https://groups.google.com/forum/#!forum/django-announce> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV> (web)
- <https://security.netapp.com/advisory/ntap-20220221-0003> (web)
- <https://www.djangoproject.com/weblog/2022/feb/01/security-releases> (web)

## Sources

- CVE List: [CVE-2022-22818](https://www.cve.org/CVERecord?id=CVE-2022-22818), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-95rw-fx8r-36v6](https://github.com/advisories/GHSA-95rw-fx8r-36v6), CC-BY-4.0, modified 2024-09-20
- NVD: [CVE-2022-22818](https://nvd.nist.gov/vuln/detail/CVE-2022-22818), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-19](https://osv.dev/vulnerability/PYSEC-2022-19), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-DJANGO-2022-22818](https://osv.dev/vulnerability/BIT-DJANGO-2022-22818), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-22818 · Whole record: https://cve.day/CVE-2022-22818.json · Rebuilt by cve.day 2026-11-25T22:58:09.466Z
