Django security releases issued: 1.10.3, 1.9.11 and 1.8.16
In accordance with our security release policy, the Django team released Django 1.10.3, Django 1.9.11, and 1.8.16. These releases addresses two security issues detailed below. We encourage all users of Django to upgrade as soon as possible.
CVE-2016-9013: User with hardcoded password created when running tests on Oracle
When running tests with an Oracle database, Django creates a temporary database user. In older versions, if a password isn't manually specified in the database settings TEST dictionary, a hardcoded password is used. This could allow an attacker with network access to the database server to connect.
This user is usually dropped after the test suite completes, but not when using the manage.py test --keepdb option or if the user has an active session (such as an attacker's connection).
A randomly generated password is now used for each test run.
Thanks Marti Raudsepp for reporting the issue.
CVE-2016-9014: DNS rebinding vulnerability when DEBUG=True
Older versions of Django don't validate the Host header against settings.ALLOWED_HOSTS when settings.DEBUG=True. This makes them vulnerable to a DNS rebinding attack.
While Django doesn't ship a module that allows remote code execution, this is at least a cross-site scripting vector, which could be quite serious if developers load a copy of the production database in development or connect to some production services for which there's no development instance, for example. If a project uses a package like the django-debug-toolbar, then the attacker could execute arbitrary SQL, which could be especially bad if the developers connect to the database with a superuser account.
settings.ALLOWED_HOSTS is now validated regardless of DEBUG. For convenience, if ALLOWED_HOSTS is empty and DEBUG=True, the following variations of localhost are allowed ['localhost', '127.0.0.1', '::1']. If your local settings file has your production ALLOWED_HOSTS value, you must now omit it to get those fallback values.
Thanks Aymeric Augustin for reporting the issue.
Affected supported versions
- Django master development branch
- Django 1.10
- Django 1.9
- Django 1.8
Per our supported versions policy, Django 1.7 and older are no longer receiving security updates.
Patches to resolve the issues have been applied to Django's master development branch and the 1.10, 1.9, and 1.8 release branches. The patches may be obtained from the following commits:
- Master: CVE-2016-9013, CVE-2016-9014
- 1.10.x: CVE-2016-9013, CVE-2016-9014
- 1.9.x: CVE-2016-9013, CVE-2016-9014
- 1.8.x: CVE-2016-9013, CVE-2016-9014
The following new releases have been issued:
- Django 1.10.3 (download Django 1.10.3 | 1.10.3 checksums)
- Django 1.9.11 (download Django 1.9.11 | 1.9.11 checksums)
- Django 1.8.16 (download Django 1.8.16 | 1.8.16 checksums)
The PGP key ID used for these releases is Tim Graham: 1E8ABDC773EDE252.
General notes regarding security reporting
As always, we ask that potential security issues be reported via private email to firstname.lastname@example.org, and not via Django's Trac instance or the django-developers list. Please see our security policies for further information.