Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1239011 - (CVE-2015-5144) CVE-2015-5144 Django: possible header injection due to validators accepting newlines in input
CVE-2015-5144 Django: possible header injection due to validators accepting n...
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20150708,repor...
: Security
Depends On: 1242350 1242719 1242720 1242721 1242722
Blocks: 1239014
  Show dependency treegraph
 
Reported: 2015-07-03 05:10 EDT by Martin Prpič
Modified: 2016-04-26 20:13 EDT (History)
22 users (show)

See Also:
Fixed In Version: Django 1.8.3, Django 1.7.9, Django 1.4.21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-25 03:27:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
newlines-1.4.x.diff (8.19 KB, text/plain)
2015-07-07 03:56 EDT, Martin Prpič
no flags Details
newlines-1.7.x.diff (10.14 KB, text/plain)
2015-07-07 03:56 EDT, Martin Prpič
no flags Details
newlines-1.8.x.diff (12.29 KB, text/plain)
2015-07-07 03:56 EDT, Martin Prpič
no flags Details
newlines-master.diff (11.93 KB, text/plain)
2015-07-07 03:56 EDT, Martin Prpič
no flags Details

  None (edit)
Description Martin Prpič 2015-07-03 05:10:36 EDT
The following flaw was found in Django:

Some of Django's built-in validators ('django.core.validators.EmailValidator', most seriously) didn't prohibit newline characters (due to the usage of '$' instead of '\Z' in the regular expressions). If an application uses values with newlines in HTTP response or email headers, it can allow an attacker to perform header injection attacks. Django itself isn't vulnerable because 'django.http.HttpResponse' and the mail sending utilities in 'django.core.mail' prohibit newlines in HTTP and SMTP headers, respectively.

While the validators have been fixed in Django, when creating HTTP responses or email messages in other ways, ensure that those methods prohibit newlines as well. Any already-existing data in your application should be checked whether it contains unexpected newlines.

'django.core.validators.validate_ipv4_address()', 'django.core.validators.validate_slug()', and 'django.core.validators.URLValidator' are also affected, however, as of Django 1.6 the 'GenericIPAddresseField', 'IPAddressField', 'SlugField', and 'URLField' form fields which use these validators all strip the input, so the possibility of newlines entering your data only exists if you are using these validators outside of the form fields

Acknowledgements:

Red Hat would like to thank the upstream Django project for reporting this issue.
Comment 1 Martin Prpič 2015-07-07 03:56:44 EDT
Created attachment 1049127 [details]
newlines-1.4.x.diff
Comment 2 Martin Prpič 2015-07-07 03:56:46 EDT
Created attachment 1049128 [details]
newlines-1.7.x.diff
Comment 3 Martin Prpič 2015-07-07 03:56:49 EDT
Created attachment 1049129 [details]
newlines-1.8.x.diff
Comment 4 Martin Prpič 2015-07-07 03:56:52 EDT
Created attachment 1049130 [details]
newlines-master.diff
Comment 5 Kurt Seifried 2015-07-09 00:38:16 EDT
This is now public: https://www.djangoproject.com/weblog/2015/jul/08/security-releases/
Comment 7 Garth Mollett 2015-07-13 23:18:25 EDT
Created Django14 tracking bugs for this issue:

Affects: epel-6 [bug 1242722]
Comment 8 Garth Mollett 2015-07-13 23:18:29 EDT
Created python-django tracking bugs for this issue:

Affects: openstack-rdo [bug 1242719]
Affects: fedora-all [bug 1242720]
Affects: epel-7 [bug 1242721]
Comment 9 Garth Mollett 2015-07-14 20:59:46 EDT
Statement:

This issue affects the version of python-django as included with Red Hat Enterprise Linux OpenStack Platform 5 and 6 however there is no known security impact in a supported use-case at this time.

A future update may address this issue.
Comment 10 Fedora Update System 2015-07-23 04:54:30 EDT
python-django-1.8.3-1.fc22 has been pushed to the Fedora 22 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.