mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed CVE-2019-14233 -- Prevented excessive HTMLParser recursion in strip_tags() when handling incomplete HTML entities.
Thanks to Guido Vranken for initial report.
This commit is contained in:
parent
7f65974f82
commit
4b78420d25
5 changed files with 55 additions and 2 deletions
|
@ -19,3 +19,20 @@ filters, which were thus vulnerable.
|
|||
The regular expressions used by ``Truncator`` have been simplified in order to
|
||||
avoid potential backtracking issues. As a consequence, trailing punctuation may
|
||||
now at times be included in the truncated output.
|
||||
|
||||
CVE-2019-14233: Denial-of-service possibility in ``strip_tags()``
|
||||
=================================================================
|
||||
|
||||
Due to the behavior of the underlying ``HTMLParser``,
|
||||
:func:`django.utils.html.strip_tags` would be extremely slow to evaluate
|
||||
certain inputs containing large sequences of nested incomplete HTML entities.
|
||||
The ``strip_tags()`` method is used to implement the corresponding
|
||||
:tfilter:`striptags` template filter, which was thus also vulnerable.
|
||||
|
||||
``strip_tags()`` now avoids recursive calls to ``HTMLParser`` when progress
|
||||
removing tags, but necessarily incomplete HTML entities, stops being made.
|
||||
|
||||
Remember that absolutely NO guarantee is provided about the results of
|
||||
``strip_tags()`` being HTML safe. So NEVER mark safe the result of a
|
||||
``strip_tags()`` call without escaping it first, for example with
|
||||
:func:`django.utils.html.escape`.
|
||||
|
|
|
@ -19,3 +19,20 @@ filters, which were thus vulnerable.
|
|||
The regular expressions used by ``Truncator`` have been simplified in order to
|
||||
avoid potential backtracking issues. As a consequence, trailing punctuation may
|
||||
now at times be included in the truncated output.
|
||||
|
||||
CVE-2019-14233: Denial-of-service possibility in ``strip_tags()``
|
||||
=================================================================
|
||||
|
||||
Due to the behavior of the underlying ``HTMLParser``,
|
||||
:func:`django.utils.html.strip_tags` would be extremely slow to evaluate
|
||||
certain inputs containing large sequences of nested incomplete HTML entities.
|
||||
The ``strip_tags()`` method is used to implement the corresponding
|
||||
:tfilter:`striptags` template filter, which was thus also vulnerable.
|
||||
|
||||
``strip_tags()`` now avoids recursive calls to ``HTMLParser`` when progress
|
||||
removing tags, but necessarily incomplete HTML entities, stops being made.
|
||||
|
||||
Remember that absolutely NO guarantee is provided about the results of
|
||||
``strip_tags()`` being HTML safe. So NEVER mark safe the result of a
|
||||
``strip_tags()`` call without escaping it first, for example with
|
||||
:func:`django.utils.html.escape`.
|
||||
|
|
|
@ -20,6 +20,23 @@ The regular expressions used by ``Truncator`` have been simplified in order to
|
|||
avoid potential backtracking issues. As a consequence, trailing punctuation may
|
||||
now at times be included in the truncated output.
|
||||
|
||||
CVE-2019-14233: Denial-of-service possibility in ``strip_tags()``
|
||||
=================================================================
|
||||
|
||||
Due to the behavior of the underlying ``HTMLParser``,
|
||||
:func:`django.utils.html.strip_tags` would be extremely slow to evaluate
|
||||
certain inputs containing large sequences of nested incomplete HTML entities.
|
||||
The ``strip_tags()`` method is used to implement the corresponding
|
||||
:tfilter:`striptags` template filter, which was thus also vulnerable.
|
||||
|
||||
``strip_tags()`` now avoids recursive calls to ``HTMLParser`` when progress
|
||||
removing tags, but necessarily incomplete HTML entities, stops being made.
|
||||
|
||||
Remember that absolutely NO guarantee is provided about the results of
|
||||
``strip_tags()`` being HTML safe. So NEVER mark safe the result of a
|
||||
``strip_tags()`` call without escaping it first, for example with
|
||||
:func:`django.utils.html.escape`.
|
||||
|
||||
Bugfixes
|
||||
========
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue