Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1202809 (CVE-2015-2316) - CVE-2015-2316 Django: possible denial of service in strip_tags()
Summary: CVE-2015-2316 Django: possible denial of service in strip_tags()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2015-2316
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1203614 1203615
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-17 13:30 UTC by Martin Prpič
Modified: 2023-05-12 08:03 UTC (History)
13 users (show)

Fixed In Version: Django 1.8rc1, Django 1.7.7, Django 1.6.11
Clone Of:
Environment:
Last Closed: 2021-10-21 00:44:22 UTC
Embargoed:


Attachments (Terms of Use)
is-safe-url-master.diff (deleted)
2015-03-17 13:33 UTC, Martin Prpič
no flags Details
strip-tags-1.8.diff (deleted)
2015-03-17 13:33 UTC, Martin Prpič
no flags Details
strip-tags-1.7.diff (deleted)
2015-03-17 13:34 UTC, Martin Prpič
no flags Details
strip-tags-1.6.diff (deleted)
2015-03-17 13:35 UTC, Martin Prpič
no flags Details
strip-tags-master.diff (deleted)
2015-03-17 13:35 UTC, Martin Prpič
no flags Details

Description Martin Prpič 2015-03-17 13:30:45 UTC
The following flaw was found in Django:

In a previous release, django.utils.html.strip_tags was changed to work iteratively. The problem is that the size of the input it is processing can increase on each iteration which results in an infinite loop in strip_tags(). This issue only affects versions of Python that haven't received a bugfix in HTMLParser (http://bugs.python.org/issue20288); namely Python < 2.7.7 and 3.3.5. Some operating system vendors have also backported the fix for the Python bug into their packages of earlier versions.

To remedy this issue, strip_tags() will now return the original input if it detects the length of the string it is processing increases. 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 django.utils.html.escape.

This issue affects Django versions 1.8.x, 1.7.x, and 1.6.x. This issue is fixed in versions 1.8 release candidate 1 (or beta 3), 1.7.7, and 1.6.11.

Acknowledgements:

Red Hat would like to thank the upstream Django project for reporting this issue.

Comment 1 Martin Prpič 2015-03-17 13:33:12 UTC
Created attachment 1002792 [details]
is-safe-url-master.diff

Comment 2 Martin Prpič 2015-03-17 13:33:56 UTC
Created attachment 1002793 [details]
strip-tags-1.8.diff

Comment 3 Martin Prpič 2015-03-17 13:34:21 UTC
Created attachment 1002794 [details]
strip-tags-1.7.diff

Comment 4 Martin Prpič 2015-03-17 13:35:04 UTC
Created attachment 1002795 [details]
strip-tags-1.6.diff

Comment 5 Martin Prpič 2015-03-17 13:35:34 UTC
Created attachment 1002796 [details]
strip-tags-master.diff

Comment 6 Martin Prpič 2015-03-19 09:33:36 UTC
External References:

https://www.djangoproject.com/weblog/2015/mar/18/security-releases/

Comment 7 Martin Prpič 2015-03-19 09:36:33 UTC
Created python-django tracking bugs for this issue:

Affects: fedora-all [bug 1203614]
Affects: epel-7 [bug 1203615]

Comment 8 Fedora Update System 2015-04-09 16:58:47 UTC
python-django-1.6.11-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.