What’s Vulnerable › Vulnerabilities
CVE-2022-22818: Cross-site Scripting in Django
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-02-03 · updated 2026-06-17
- Weakness: CWE-79
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.
Affected products
- Debian Linux: 11.0
- Django: from 2.2 before 2.2.27; from 3.2 before 3.2.12; from 4.0 before 4.0.2 — fixed in 2.2.27, 3.2.12, 4.0.2
- Fedoraproject Fedora: 35
- Pypi Django: from 2.2 before 2.2.27; from 3.2 before 3.2.12; from 4.0 before 4.0.2; 2.2, 2.2.1, 2.2.10, 2.2.11, 2.2.12, 2.2.13 (+35) — fixed in 2.2.27, 3.2.12, 4.0.2
How to fix
Upgrade to a fixed version: Django 2.2.27, 3.2.12, 4.0.2; Pypi Django 2.2.27, 3.2.12, 4.0.2. Check the vendor advisory for mitigations.
References
- https://docs.djangoproject.com/en/4.0/releases/security/
- 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/
- https://www.debian.org/security/2022/dsa-5254
- https://www.djangoproject.com/weblog/2022/feb/01/security-releases/
- https://docs.djangoproject.com/en/4.0/releases/security/
- 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/
- https://www.debian.org/security/2022/dsa-5254
- https://www.djangoproject.com/weblog/2022/feb/01/security-releases/
Get alerted when CVE-2022-22818 or the next vulnerability affects your stack