CVE-2022-22818: XSS
A flaw was found in Django. The {% debug %} template tag did not properly encode the current context, posing a Cross-site scripting attack vector (XSS).
Other sources
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.
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.
— GitHub
The {% debug %} template tag didn't properly encode the current context, posing an XSS attack vector. In order to avoid this vulnerability, {% debug %} no longer outputs an information when the DEBUG setting is False, and it ensures all context variables are correctly escaped when the DEBUG setting is True.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/python-django20to a version that resolves this vulnerability.Fixed in 0:2.0.13-18.el8 - Upgrade
Upgrade
redhat/python-djangoto a version that resolves this vulnerability.Fixed in 0:3.2.13-1.el8 - Upgrade
Upgrade
redhat/python-djangoto a version that resolves this vulnerability.Fixed in 0:3.2.14-2.el8 - Upgrade
Upgrade
debian/python-djangoto a version that resolves this vulnerability.Fixed in 2:3.2.12-1Fixed in 2:4.0.2-1Fixed in 2:2.2.28-1~deb11u1 - Upgrade
Upgrade
redhat/djangoto a version that resolves this vulnerability.Fixed in 4.0.2 - Upgrade
Upgrade
redhat/djangoto a version that resolves this vulnerability.Fixed in 3.2.12 - Upgrade
Upgrade
redhat/djangoto a version that resolves this vulnerability.Fixed in 2.2.27 - Upgrade
Upgrade
pip/djangoto a version that resolves this vulnerability.Fixed in 4.0.2 - Upgrade
Upgrade
pip/djangoto a version that resolves this vulnerability.Fixed in 3.2.12 - Upgrade
Upgrade
pip/djangoto a version that resolves this vulnerability.Fixed in 2.2.27 - Upgrade
Upgrade
alpine/py3-djangoto a version that resolves this vulnerability.Fixed in 3.2.12-r0 - Upgrade
Upgrade
debian/python-djangoto a version that resolves this vulnerability.Fixed in 2:3.2.12-1 - Upgrade
Upgrade
debian/python-djangoto a version that resolves this vulnerability.Fixed in 3:3.2.25-0+deb12u3Fixed in 3:3.2.25-0+deb12u6Fixed in 3:4.2.28-0+deb13u2Fixed in 3:4.2.28-0+deb13u1Fixed in 3:5.2.17-2Fixed in 3:5.2.19-1
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the vulnerability ID?
The vulnerability ID is CVE-2022-22818.
What is the severity level of CVE-2022-22818?
The severity level of CVE-2022-22818 is medium with a CVSS score of 6.1.
What is the affected software?
The affected software includes Django versions 2.2 before 2.2.27, 3.2 before 3.2.12, and 4.0 before 4.0.2.
How does the vulnerability impact the affected software?
The vulnerability in Django may lead to XSS (Cross-Site Scripting) attacks.
How do I fix CVE-2022-22818?
You can fix CVE-2022-22818 by upgrading Django to versions 2.2.27, 3.2.12, or 4.0.2 depending on your current version.