CVE-2022-22818 json
Cross-site Scripting in Django
published 2022-02-03 4 y ago modified 2026-09-08 2 mo ago also BIT-django-2022-22818 , EUVD-2022-0086 , GHSA-95rw-fx8r-36v6 , PYSEC-2022-19
- cvss
- 6.1
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.4%
- EPSS 3.4% chance of exploitation in 30 days, percentile 88%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi django 2.2.27, 3.2.12, 4.0.2
- bitnami django 2.2.27, 3.2.12, 4.0.2
- djangoproject django 2.2.27, 3.2.12, 4.0.2
- python-django Debian 14, Debian 13, Debian 12 2:3.2.12-1
debian advisories DEBIAN-CVE-2022-22818
- python-django Ubuntu 18.04 LTS 1:1.11.11-1ubuntu1.16
- python-django Ubuntu 20.04 LTS 2:2.2.12-1ubuntu0.10
- python-django Ubuntu Pro 14.04 LTS 1.6.11-0ubuntu1.3+esm4
- python-django Ubuntu Pro 16.04 LTS 1.8.7-1ubuntu5.15+esm4
ubuntu advisories UBUNTU-CVE-2022-22818
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- foreman satellite utils 6.12, satellite capsule 6.12, satellite 6.12 3.3.0.17-1.el8sat
- candlepin satellite 6.12 4.1.15-1.el8sat
- foreman-cli satellite utils 6.12, satellite 6.12 3.3.0.17-1.el8sat
- foreman-ec2 satellite 6.12 3.3.0.17-1.el8sat
- foreman-gce satellite 6.12 3.3.0.17-1.el8sat
- rubygem-git satellite 6.12 1.11.0-1.el8sat
- foreman-ovirt satellite 6.12 3.3.0.17-1.el8sat
- python-django satellite capsule 6.12, satellite 6.12 3.2.14-2.el8pc
red hat advisories RHSA-2022:8506RHSA-2022:5498RHSA-2022:8872RHSA-2022:8853
- python-Django OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.11.29-3.39.1
- venv-openstack-aodh OpenStack Cloud 8, HPE Helion OpenStack 8 5.1.1~dev7-12.37.1
- venv-openstack-heat OpenStack Cloud 8, HPE Helion OpenStack 8 9.0.8~dev22-12.40.1
- venv-openstack-nova OpenStack Cloud 8, HPE Helion OpenStack 8 16.1.9~dev92-11.41.1
- venv-openstack-swift OpenStack Cloud 8, HPE Helion OpenStack 8 2.15.2_2.15.2_2.15.2~dev32-11.28.1
- venv-openstack-trove OpenStack Cloud 8, HPE Helion OpenStack 8 8.0.2~dev2-11.37.1
- venv-openstack-cinder OpenStack Cloud 8, HPE Helion OpenStack 8 11.2.3~dev29-14.39.1
- venv-openstack-glance OpenStack Cloud 8, HPE Helion OpenStack 8 15.0.3~dev3-12.36.1
suse advisories SUSE-SU-2022:0286-1SUSE-SU-2022:0285-1
- python-Django5 openSUSE Tumbleweed 5.2.16-1.1
- python-Django4 openSUSE Tumbleweed 4.2.30-4.1
- python-Django6 openSUSE Tumbleweed 6.0-1.1
- python-Django openSUSE Tumbleweed 5.1.5-1.1
- python-Django4 openSUSE Tumbleweed 4.2.14-1.1
- python-Django openSUSE Tumbleweed 4.0.2-1.1
- python-Django Package Hub 15 SP3, openSUSE Leap 15.3 2.2.28-bp153.2.3.1
opensuse advisories openSUSE-SU-2026:11270-1openSUSE-SU-2026:11235-1openSUSE-SU-2026:10005-1openSUSE-SU-2025:14662-1openSUSE-SU-2024:14208-1openSUSE-SU-2024:11804-1
- libdb Rocky Linux 8 5.3.28-42.el8_4
rocky linux advisories RLSA-2022:8506RLSA-2022:5498
- py3-django Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 3.2.12-r0
alpine advisories ALPINE-CVE-2022-22818
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-django Arch Linux 4.0.2-1
arch linux advisories AVG-2808
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-22818 updated cvss 6.1
django: Possible XSS via '{% debug %}' template tag
-
Red Hat Ansible Automation Platform 1.2 python-django Red Hat Ansible Automation Platform 2 python-django Red Hat Ansible Tower 3 djangoaffected: no fix planned “Will not fix”
-
Red Hat Ceph Storage 2 python-django, calamari-server, python-django-bash-completion Red Hat Ceph Storage 3 python-django, python-django-bash-completion Red Hat OpenStack Platform 13 (Queens) python-django, python2-django, python-django-bash-completionaffected: no fix planned “Out of support scope”
-
Red Hat Satellite 6 python3-djangoaffected: no fix available
-
Red Hat Storage 3 python-django, python2-django, python-django-bash-completion Red Hat Update Infrastructure 3 for Cloud Providers python-djangoaffected: no fix planned “Will not fix”
-
Red Hat Update Infrastructure 4 for Cloud Providers python-djangoaffected: no fix available
-
Red Hat OpenStack Platform 16.1 python-django20 2.0.13-18.el8ost, python3-django20 2.0.13-18.el8ost, python-django20-bash-completion 2.0.13-18.el8ostfixed: vendor fix RHSA-2022:8872
-
Red Hat OpenStack Platform 16.2 python-django20 2.0.13-18.el8ost, python3-django20 2.0.13-18.el8ostfixed: vendor fix RHSA-2022:8853
-
Red Hat Satellite 6.11 for RHEL 8 python-django 3.2.13-1.el8pc, python38-django 3.2.13-1.el8pcfixed: vendor fix RHSA-2022:5498
show 2 moreshow fewer
-
Red Hat Satellite 6.12 for RHEL 8 python-django 3.2.14-2.el8pc, python39-django 3.2.14-2.el8pcfixed: vendor fix RHSA-2022:8506
-
Red Hat Satellite 6.11 for RHEL 7 tfm 7.0-1.el7sat, gofer 2.12.5-7.el7sat, katello 4.3.0-3.el7sat, libsolv 0.7.22-1.el7pc, libcomps 0.1.18-1.el7pc, libsolv0 0.6.34-4.el7sat, +638 more Red Hat Satellite 6.11 for RHEL 8 libdb 5.3.28-42.el8_4, katello 4.3.0-3.el8sat, libsolv 0.7.22-1.el8pc, libcomps 0.1.18-1.el8pc, python-idna 3.3-1.el8pc, python-pbr 5.6.0-1.el8pc, +627 more Red Hat Satellite 6.12 for RHEL 8 cjson 1.7.14-5.el8sat, libdb 5.3.28-42.el8_4, katello 4.5.0-1.el8sat, libsolv 0.7.22-4.el8pc, libcomps 0.1.18-4.el8pc, python-idna 3.3-2.el8pc, +639 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
3.36% chance of exploitation in the next 30 days, higher than 88% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- djangoproject.com https://www.djangoproject.com/weblog/2022/feb/01/security-releases/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
| OSV | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| 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 |
| bitnami | django | >=2.2.0, <2.2.27 >=3.2.0, <3.2.12 >=4.0.0, <4.0.2 |
2.2.27 3.2.12 4.0.2 |
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
- Technology feeds
References
-
docs.djangoproject.com
/en/4.0/releases/security/
patch, third-party-advisory, advisory, web
-
djangoproject.com
/weblog/2022/feb/01/security-releases/
exploit, patch, third-party-advisory, advisory, article
-
github.com
/django/django/commit/01422046065d2b51f8f613409cad2c81b39487e5
web
-
github.com
/django/django/commit/1a1e8278c46418bde24c86a65443b0674bae65e2
web
-
github.com
/django/django/commit/c27a7eb9f40b64990398978152e62b6ff839c2e6
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV/
vendor-advisory, web
-
debian.org
/security/2022/dsa-5254
vendor-advisory, web, third-party-advisory, advisory
-
groups.google.com
/forum/#%21forum/django-announce
web
-
security.netapp.com
/advisory/ntap-20220221-0003/
third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-22818
advisory, web
-
docs.djangoproject.com
/en/4.0/releases/security
web
-
github.com
/advisories/GHSA-95rw-fx8r-36v6
advisory
-
github.com
/django/django
package
-
github.com
/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-19.yaml
web
-
groups.google.com
/forum/#!forum/django-announce
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/B4SQG2EAF4WCI2SLRL6XRDJ3RPK3ZRDV
web
-
security.netapp.com
/advisory/ntap-20220221-0003
web
-
djangoproject.com
/weblog/2022/feb/01/security-releases
web
Sources
- CVE List CVE-2022-22818
- GitHub Advisory GHSA-95rw-fx8r-36v6
- NVD CVE-2022-22818
- OSV BIT-django-2022-22818
- OSV PYSEC-2022-19
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.