Live threats

All CVEs / Djangoproject

CVE-2022-22818Djangoproject Django

Medium 6.1 No auth needed

Priority
52
CVSS 3.1
6.1
EPSS
2.8%
probability of exploitation in 30 days · percentile 87
Auth required
No
Published
Feb 3, 2022
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-79
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Django.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
PyPI django ≥ 2.2 < 2.2.27 2.2.27 pip install "django>=2.2.27"
PyPI django ≥ 3.2 < 3.2.12 3.2.12 pip install "django>=3.2.12"
PyPI django ≥ 4.0 < 4.0.2 4.0.2 pip install "django>=4.0.2"
PyPI django ≥ 2.2 < 2.2.27 2.2.27 pip install "django>=2.2.27"
PyPI django ≥ 3.2 < 3.2.12 3.2.12 pip install "django>=3.2.12"
PyPI django ≥ 4.0 < 4.0.2 4.0.2 pip install "django>=4.0.2"

Per OSV / GitHub Advisories (GHSA-95rw-fx8r-36v6, PYSEC-2022-19). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
djangoprojectdjango≥ 2.2 < 2.2.27
djangoprojectdjango≥ 3.2 < 3.2.12
djangoprojectdjango≥ 4.0 < 4.0.2
fedoraprojectfedora35
debiandebian_linux11.0

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.