CVE-2022-22818
MEDIUM 6.1CVSS 3.1Cross-site Scripting in Django
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.
- Published
- 3 Feb 2022
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- BIT-django-2022-22818GHSA-95rw-fx8r-36v6PYSEC-2022-19
- Sources
- NVDJSONOSV GHSA-95rw-fx8r-36v6JSONOSV PYSEC-2022-19JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | 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 | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 2.2, < 2.2.27 | 2.2.27 |
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 3.2, < 3.2.12 | 3.2.12 |
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 4.0, < 4.0.2 | 4.0.2 |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
= 35 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* |
= 11.0 | |
| OSV | PyPI | django | >= 2.2, < 2.2.27 | 2.2.27 |
| OSV | PyPI | django | >= 3.2, < 3.2.12 | 3.2.12 |
| OSV | PyPI | django | >= 4.0, < 4.0.2 | 4.0.2 |
| OSV | PyPI | django | >= 2.2, < 2.2.27; >= 3.2, < 3.2.12; >= 4.0, < 4.0.2 | 2.2.27, 3.2.12, 4.0.2 |
References
- https://docs.djangoproject.com/en/4.0/releases/security/ · Patch, Third Party Advisory, WEB
- https://groups.google.com/forum/#%21forum/django-announce
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV/
- https://security.netapp.com/advisory/ntap-20220221-0003/ · Third Party Advisory, WEB
- https://www.debian.org/security/2022/dsa-5254 · Third Party Advisory, WEB
- https://www.djangoproject.com/weblog/2022/feb/01/security-releases/ · Exploit, Patch, Third Party Advisory, WEB, ARTICLE
- https://nvd.nist.gov/vuln/detail/CVE-2022-22818 · ADVISORY
- 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://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
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 3 Feb 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 3 Feb 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 4 Feb 2022)