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:56:29 +0100
commitc27a7eb9f40b64990398978152e62b6ff839c2e6 (patch)
treee96c6befb58708ce58e37d6b139b890e60bd9dd5 /docs
parent4cafd3aacb0e7bc583f838ef2b0293786b329471 (diff)
[2.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
2 files changed, 16 insertions, 2 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index bc24308ba4..c4b0fa3987 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``.