summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2022-01-02 00:37:40 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-01 07:53:21 +0100
commit1a1e8278c46418bde24c86a65443b0674bae65e2 (patch)
tree837a5ed39f47ea3048aa029c18cfb172a90b9ab4 /docs
parenta7e89fe77683af562fa00143cd1af32e20425797 (diff)
[3.2.x] Fixed CVE-2022-22818 -- Fixed possible XSS via {% debug %} template tag.
Thanks Keryn Knight for the report. Backport of 394517f07886495efcf79f95c7ee402a9437bd68 from main. Co-authored-by: Adam Johnson <me@adamj.eu>
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/templates/builtins.txt8
-rw-r--r--docs/releases/2.2.27.txt10
-rw-r--r--docs/releases/3.2.12.txt10
3 files changed, 25 insertions, 3 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index ee7cc0eda3..22509a2a7e 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -194,7 +194,13 @@ from its first value when it's next encountered.
---------
Outputs a whole load of debugging information, including the current context
-and imported modules.
+and imported modules. ``{% debug %}`` outputs nothing when the :setting:`DEBUG`
+setting is ``False``.
+
+.. versionchanged:: 2.2.27
+
+ In older versions, debugging information was displayed when the
+ :setting:`DEBUG` setting was ``False``.
.. templatetag:: extends
diff --git a/docs/releases/2.2.27.txt b/docs/releases/2.2.27.txt
index a35082fa33..b1712c649c 100644
--- a/docs/releases/2.2.27.txt
+++ b/docs/releases/2.2.27.txt
@@ -6,4 +6,12 @@ Django 2.2.27 release notes
Django 2.2.27 fixes two security issues with severity "medium" in 2.2.26.
-...
+CVE-2022-22818: Possible XSS via ``{% debug %}`` template tag
+=============================================================
+
+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``.
diff --git a/docs/releases/3.2.12.txt b/docs/releases/3.2.12.txt
index 8e4e9149fe..31bc7d2c59 100644
--- a/docs/releases/3.2.12.txt
+++ b/docs/releases/3.2.12.txt
@@ -6,4 +6,12 @@ Django 3.2.12 release notes
Django 3.2.12 fixes two security issues with severity "medium" in 3.2.11.
-...
+CVE-2022-22818: Possible XSS via ``{% debug %}`` template tag
+=============================================================
+
+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``.